pgcluu icon indicating copy to clipboard operation
pgcluu copied to clipboard

Redundant queries: bug with partitioning

Open Krysztophe opened this issue 3 years ago • 0 comments

The missing indexes query is not partitioning_aware. In a db made with pgbench --foreign-keys --partitions=2, I get this:

 pgbench_accounts   ║ CREATE INDEX CONCURRENTLY idx_pgbench_accounts_bid ON pgbench_accounts (bid) ;
 pgbench_accounts_1 ║ CREATE INDEX CONCURRENTLY idx_pgbench_accounts_1_bid ON pgbench_accounts_1 (bid) ;
 pgbench_accounts_2 ║ CREATE INDEX CONCURRENTLY idx_pgbench_accounts_2_bid ON pgbench_accounts_2 (bid) ;

It seems that this check solves the problem:

                      AND NOT pg_class.relispartition      --v10
                      AND pg_constraint.conparentid = 0 --v11

I may try a PR once #152 is finished.

Krysztophe avatar May 25 '22 14:05 Krysztophe