Re: Optimization of partial index creation for a new column

2025-12-14 Thread Tom Lane
Andres Freund writes: > On 2025-12-14 23:13:49 +0300, Александр Асафов wrote: >> I have a feature suggestion to optimize the creation of a partial >> index. In some cases, it is possible to skip a full table scan. For >> example: >> ... >> How complex would a patch with this optimization be? Will

Re: Optimization of partial index creation for a new column

2025-12-14 Thread Andres Freund
Hi, On 2025-12-14 23:13:49 +0300, Александр Асафов wrote: > I have a feature suggestion to optimize the creation of a partial > index. In some cases, it is possible to skip a full table scan. For > example: > > BEGIN; > ALTER TABLE test ADD COLUMN (newcol int); > CREATE INDEX newindex ON test(new

Optimization of partial index creation for a new column

2025-12-14 Thread Александр Асафов
Hello hackers, I have a feature suggestion to optimize the creation of a partial index. In some cases, it is possible to skip a full table scan. For example: BEGIN; ALTER TABLE test ADD COLUMN (newcol int); CREATE INDEX newindex ON test(newcol) WHERE newcol IS NOT NULL; COMMIT; In this case, the