Skip to content

Commit

Permalink
document impact of using estimated table metadata (and revert last co…
Browse files Browse the repository at this point in the history
…mmit)
  • Loading branch information
jef-n committed Jun 7, 2011
1 parent c1065b9 commit a579685
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 42 deletions.
19 changes: 0 additions & 19 deletions resources/context_help/QgsNewConnection-de_DE

This file was deleted.

19 changes: 0 additions & 19 deletions resources/context_help/QgsNewConnection-en_US

This file was deleted.

32 changes: 32 additions & 0 deletions resources/context_help/QgsPgNewConnection-de_DE
@@ -0,0 +1,32 @@
<h3>Neue PostgreSQL-Verbindung erstellen</h3>
In diesem Dialog kann eine Verbindung zu einer PostgreSQL-Datenbank eingestellt werden.
<p>
<ul>
<li> <label>Name</label> Ein Name um die Verbindung zu identifizieren.

<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>.

<li> <label>Host</label> Name oder IP-Adresse des Computers, der den Datenbankserver beherbergt (für lokale Verbindungen und Dienste frei lassen).

<li> <label>Port</label> IP-Port des Datenbankservers (für lokale Verbindungen oder den voreingestellten Port 5432 frei lassen).

<li> <label>Datenbank</label> Name der Datenbank (für die voreingestellte Datenbank leer lassen).

<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.

<li> <label>Benutzername</label> Datenbankbenutzername.
<li> <label>Passwort</label> Datenbankpasswort.

<li> <label>Benutzername speichern</label> Legt fest, dass der Benutzername in der Verbindungseinstellungen gespeichert werden soll.

<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>

<li> <label>Nur in geometry_columns nachsehen</label> Legt fest, dass nur "gelistete" Geometriespalten benutzt werden sollen - statt alle Tabellen nach Geometriespalten zu durchsuchen.

<li> <label>Nur im Schema 'public' nachsehen</label> Legt fest, dass nur das Schema 'public' berücksichtigt werden soll - statt alle zugänglichen Tabellen.

<li> <label>Auch geometrielose Tabellen anzeigen</label> Legt fest, dass normalerweise nicht nur Tabellen mit Geometrie, sondern alle Tabellen aufgelistet werden sollen.

<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).

</ul>
32 changes: 32 additions & 0 deletions resources/context_help/QgsPgNewConnection-en_US
@@ -0,0 +1,32 @@
<h3>Create a New PostgreSQL Connection</h3>
This dialog allows you to define the settings for a connection to a PostgreSQL database.
<p>
<ul>
<li> <label>Name</label> A name to identify the connection settings.

<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>.

<li> <label>Host</label> Name or IP address of the computer hosting the database server (leave blank for local connections or services).

<li> <label>Port</label> IP port used by the database server (leave blank for local connections or to use default port 5432).

<li> <label>Database</label> Name of the database (leave blank for default database).

<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

<li> <label>Username</label> Database user name.
<li> <label>Password</label> Database password.

<li> <label>Save Username</label> Indicates whether to save the database user name in the connection configuration.

<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>

<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.

<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.

<li> <label>Also list tables with no geometry</label> Indicates that tables without geometry should also be listed by default.

<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).

</ul>
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2890,9 +2890,10 @@ long QgsPostgresProvider::featureCount() const
// get total number of features
QString sql;

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


Result result = connectionRO->PQexec( sql );

QgsDebugMsg( "number of features as text: " +
Expand Down

0 comments on commit a579685

Please sign in to comment.