Bug report #7780
Incorrect number of rows when testing layer filter expression
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16675|
When one tests the layer filter expression, the number of rows showed is the total number of row in the layer instead of the result of the filter.
The filter works well.
Does not happen in 1.8, it's a regression, so I set it as a blocker.
#1 Updated by Matthias Kuhn over 6 years ago
- Priority changed from Severe/Regression to Normal
From qgspostgresprovider.cpp (Line 2315):
// 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 ( !mIsQuery && mUseEstimatedMetadata )
The currently supported solution is to disable "Use estimated metadata" for your database connection.
If you see a better way of managing this issue, please share your ideas. I have changed the priority to Normal since this is expected behavior (although admittedly odd)
#5 Updated by Sandro Santilli over 5 years ago
I was also bitten by this problem, still in 2.0 and in 2.2.
Being a regression from 1.8 I don't see how it becomes a feature request.
Another thing I don't see is why mIsQuery should disable estimation while filter should not, they both basically introduce a filtering, so should be both threated the same way, IMHO (ie: disabling the estimation)
#7 Updated by Alexandre Neto over 2 years ago
As far I understand, the "Use Estimated metadata" is not used by default. I can't remember if that was the case back then... anyway, I would close this ticket, the behavior is fully documented in here: