sraoss / pg_ivm

IVM (Incremental View Maintenance) implementation as a PostgreSQL extension
Other
854 stars 24 forks source link

Fix a bug of automatic index creation #40

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.