sraoss / pgsql-ivm

IVM (Incremental View Maintenance) development for PostgreSQL
Other
129 stars 12 forks source link

Fix a bug of automatic index creation #152

Closed yugo-n closed 1 year ago

yugo-n commented 1 year ago

It is intended that a unique index is created only if all primary keys of tables in FROM clause appear in the target list. For this purpose, pull_varnos_of_level was used to extract relations in the FROM clause, but it is incorrect and actually we should use get_relids_in_jointree.

Due to this bug, an index could be created even even where there is a pkey attribute from just one of relations in FROM clause. (#151)

thoshiai commented 1 year ago

Thank you for creating patch! I checked codes and tested some cases, no problem. This looks so good.