pgsql: Speed up finding EquivalenceClasses for a given set of rels

2019-07-20 Thread David Rowley
Speed up finding EquivalenceClasses for a given set of rels Previously in order to determine which ECs a relation had members in, we had to loop over all ECs stored in PlannerInfo's eq_classes and check if ec_relids mentioned the relation. For the most part, this was fine, as generally, unless qu

pgsql: Don't rely on estimates for amcheck Bloom filters.

2019-07-20 Thread Peter Geoghegan
Don't rely on estimates for amcheck Bloom filters. Solely relying on a relation's reltuples/relpages estimate to size the Bloom filters used by amcheck verification makes verification less effective when the estimates are very stale. In extreme cases, verification options that use Bloom filters i

pgsql: Don't rely on estimates for amcheck Bloom filters.

2019-07-20 Thread Peter Geoghegan
Don't rely on estimates for amcheck Bloom filters. Solely relying on a relation's reltuples/relpages estimate to size the Bloom filters used by amcheck verification makes verification less effective when the estimates are very stale. In extreme cases, verification options that use Bloom filters i

pgsql: Don't rely on estimates for amcheck Bloom filters.

2019-07-20 Thread Peter Geoghegan
Don't rely on estimates for amcheck Bloom filters. Solely relying on a relation's reltuples/relpages estimate to size the Bloom filters used by amcheck verification makes verification less effective when the estimates are very stale. In extreme cases, verification options that use Bloom filters i

pgsql: Rework examine_opclause_expression to use varonleft

2019-07-20 Thread Tomas Vondra
Rework examine_opclause_expression to use varonleft The examine_opclause_expression function needs to return information on which side of the operator we found the Var, but the variable was called "isgt" which is rather misleading (it assumes the operator is either less-than or greater-than, but i

pgsql: Use column collation for extended statistics

2019-07-20 Thread Tomas Vondra
Use column collation for extended statistics The current extended statistics code was a bit confused which collation to use. When building the statistics, the collations defined as default for the data types were used (since commit 5e0928005). The MCV code was however using the column collations

pgsql: Use column collation for extended statistics

2019-07-20 Thread Tomas Vondra
Use column collation for extended statistics The current extended statistics code was a bit confused which collation to use. When building the statistics, the collations defined as default for the data types were used (since commit 5e0928005). The MCV code was however using the column collations

pgsql: Rework examine_opclause_expression to use varonleft

2019-07-20 Thread Tomas Vondra
Rework examine_opclause_expression to use varonleft The examine_opclause_expression function needs to return information on which side of the operator we found the Var, but the variable was called "isgt" which is rather misleading (it assumes the operator is either less-than or greater-than, but i