Skip to content

Commit

Permalink
postgres provider: use st_estimatedextent only when 'use estimated me…
Browse files Browse the repository at this point in the history
…tadata' is enabled (fixes #21718)

(cherry picked from commit 95bd748)
  • Loading branch information
jef-n committed Apr 5, 2019
1 parent 7ffc3ef commit d3ec6b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3237,7 +3237,7 @@ QgsRectangle QgsPostgresProvider::extent() const
QString ext;

// get the extents
if ( !mIsQuery && ( mUseEstimatedMetadata || mSqlWhereClause.isEmpty() ) )
if ( !mIsQuery && mUseEstimatedMetadata )
{
// do stats exists?
sql = QStringLiteral( "SELECT count(*) FROM pg_stats WHERE schemaname=%1 AND tablename=%2 AND attname=%3" )
Expand Down

0 comments on commit d3ec6b5

Please sign in to comment.