Skip to content

Commit a8486f0

Browse files
jef-nmhugent
authored andcommittedJun 10, 2011
document impact of using estimated table metadata (and revert last commit)
1 parent 46bd8dd commit a8486f0

14 files changed

+68
-42
lines changed
 

‎resources/context_help/QgsNewConnection-de_DE

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎resources/context_help/QgsNewConnection-en_US

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<h3>Neue PostgreSQL-Verbindung erstellen</h3>
2+
In diesem Dialog kann eine Verbindung zu einer PostgreSQL-Datenbank eingestellt werden.
3+
<p>
4+
<ul>
5+
<li> <label>Name</label> Ein Name um die Verbindung zu identifizieren.
6+
7+
<li> <label>Dienst</label> Der Name eines Dienstes aus der <a href="http://www.postgresql.org/docs/current/static/libpq-pgservice.html">Connection Service Datei (englisch)</a>.
8+
9+
<li> <label>Host</label> Name oder IP-Adresse des Computers, der den Datenbankserver beherbergt (für lokale Verbindungen und Dienste frei lassen).
10+
11+
<li> <label>Port</label> IP-Port des Datenbankservers (für lokale Verbindungen oder den voreingestellten Port 5432 frei lassen).
12+
13+
<li> <label>Datenbank</label> Name der Datenbank (für die voreingestellte Datenbank leer lassen).
14+
15+
<li> <label>SSL-Modus</label> <a href="http://www.postgresql.org/docs/9.0/static/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS">SSL-Modus (englisch)</a> der Verbindung.
16+
17+
<li> <label>Benutzername</label> Datenbankbenutzername.
18+
<li> <label>Passwort</label> Datenbankpasswort.
19+
20+
<li> <label>Benutzername speichern</label> Legt fest, dass der Benutzername in der Verbindungseinstellungen gespeichert werden soll.
21+
22+
<li> <label>Passwort speichern</label> Legt fest, dass das Passwort in den Verbindungseinstellungen gespeichert werden soll. <font color="red">Passworte werden dann im <strong>Klartext</strong> in der Systemkonfiguration und Projektdateien gespeichert!</font>
23+
24+
<li> <label>Nur in geometry_columns nachsehen</label> Legt fest, dass nur "gelistete" Geometriespalten benutzt werden sollen - statt alle Tabellen nach Geometriespalten zu durchsuchen.
25+
26+
<li> <label>Nur im Schema 'public' nachsehen</label> Legt fest, dass nur das Schema 'public' berücksichtigt werden soll - statt alle zugänglichen Tabellen.
27+
28+
<li> <label>Auch geometrielose Tabellen anzeigen</label> Legt fest, dass normalerweise nicht nur Tabellen mit Geometrie, sondern alle Tabellen aufgelistet werden sollen.
29+
30+
<li> <label>Geschätzte Tabellenmetadaten nutzen</label> Wenn die Layer initialisiert werden, k&ouml;nnen mehrere Abfragen n&ouml;tig sein, um die Eigenschaften der Geometrien der Datenbanktabelle zu bestimmen. Wenn diese Option gew&auml;hlt ist werden die Abfragen nur einige Zeilen und die Tabellenstatistiken, statt der gesamten Tabelle, betrachten. Dies beschleunigt die Benutzung Layer erheblich, kann aber auch zu falschen Ergebnissen f&uuml;hren (z.B. wird die <font color="red">Objektanzahl</font> von gefilterten Layern nicht genau bestimmt).
31+
32+
</ul>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<h3>Create a New PostgreSQL Connection</h3>
2+
This dialog allows you to define the settings for a connection to a PostgreSQL database.
3+
<p>
4+
<ul>
5+
<li> <label>Name</label> A name to identify the connection settings.
6+
7+
<li> <label>Service</label> A name of a service listed in the <a href="http://www.postgresql.org/docs/current/static/libpq-pgservice.html">Connection Service File</a>.
8+
9+
<li> <label>Host</label> Name or IP address of the computer hosting the database server (leave blank for local connections or services).
10+
11+
<li> <label>Port</label> IP port used by the database server (leave blank for local connections or to use default port 5432).
12+
13+
<li> <label>Database</label> Name of the database (leave blank for default database).
14+
15+
<li> <label>SSL mode</label> <a href="http://www.postgresql.org/docs/9.0/static/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS">SSL mode</a> of the connection
16+
17+
<li> <label>Username</label> Database user name.
18+
<li> <label>Password</label> Database password.
19+
20+
<li> <label>Save Username</label> Indicates whether to save the database user name in the connection configuration.
21+
22+
<li> <label>Save Password</label> Indicates whether to save the database password in the connection settings. <font color="red">Passwords are saved in <strong>clear text</strong> in the system configuration and in the project files!</font>
23+
24+
<li> <label>Only look in the geometry_columns table</label> Indicates that only "listed" geometry columns should be used - opposed to scanning all tables for geometry columns.
25+
26+
<li> <label>Only look in the 'public' schema</label> Indicates that only tables in the 'public' schema should be considers - opposed to all accessible tables.
27+
28+
<li> <label>Also list tables with no geometry</label> Indicates that tables without geometry should also be listed by default.
29+
30+
<li> <label>Use estimated table metadata</label> When initializing layers, various queries may be needed to establish the characteristics of the geometries stored in the database table. When this option is checked, these queries examine only a sample of the rows and use the table statistics, rather than the entire table. This can drastically speed up operations on large datasets, but may result in incorrect characterization of layers (eg. the <font color="red">feature count</font> of filtered layers will not be accurately determined).
31+
32+
</ul>

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2890,9 +2890,10 @@ long QgsPostgresProvider::featureCount() const
28902890
// get total number of features
28912891
QString sql;
28922892

2893-
// only use estimated metadata when there is no where clause, otherwise
2894-
// we get an incorrect feature count for the subset
2895-
if ( !isQuery && mUseEstimatedMetadata && sqlWhereClause.isEmpty())
2893+
// use estimated metadata even when there is a where clause,
2894+
// although we get an incorrect feature count for the subset
2895+
// - but make huge dataset usable.
2896+
if ( !isQuery && mUseEstimatedMetadata )
28962897
{
28972898
sql = QString( "select reltuples::int from pg_catalog.pg_class where oid=regclass(%1)::oid" ).arg( quotedValue( mQuery ) );
28982899
}
@@ -2906,7 +2907,6 @@ long QgsPostgresProvider::featureCount() const
29062907
}
29072908
}
29082909

2909-
29102910
Result result = connectionRO->PQexec( sql );
29112911

29122912
QgsDebugMsg( "number of features as text: " +

0 commit comments

Comments
 (0)
Please sign in to comment.