Re: [GENERAL] Loose indexscan and partial indexes

2017-02-10 Thread Peter J. Holzer
On 2017-02-10 14:24:36 +0100, Thomas Kellerer wrote: > Peter J. Holzer schrieb am 10.02.2017 um 14:02: > > So it's doing a sequential scan on the initial select in the recursive > > CTE, but using the index on the subsequent selects. > > > > But why? If it uses the index on > > SELECT MIN(peri

Re: [GENERAL] Loose indexscan and partial indexes

2017-02-10 Thread Thomas Kellerer
Peter J. Holzer schrieb am 10.02.2017 um 14:02: > So it's doing a sequential scan on the initial select in the recursive > CTE, but using the index on the subsequent selects. > > But why? If it uses the index on > SELECT MIN(periodizitaet) FROM facttable_imf_ifs WHERE periodizitaet > 'x' > sho

[GENERAL] Loose indexscan and partial indexes

2017-02-10 Thread Peter J. Holzer
I was almost through writing a bug report when I figured out what I was doing wrong, so I'll post it here in the hope that it prevents someone from tearing their hair out. I was trying to use a loose index scan as described on https://wiki.postgresql.org/wiki/Loose_indexscan on a column with just