Re: index paths and enable_indexscan

2020-04-14 Thread Robert Haas
On Tue, Apr 14, 2020 at 10:21 AM Tom Lane wrote: > Awhile back I'd looked into getting rid of disable_cost altogether > by dint of not generating disabled paths. It's harder than it > sounds. We could perhaps change this particular case, but it's > not clear that there's any real benefit of maki

Re: index paths and enable_indexscan

2020-04-14 Thread Tom Lane
Amit Langote writes: > I was really thinking of this in terms of planner effort, which for > creating an index path is more than creating sequential path, although > sure the payoff can be great. That is, I want the planner to avoid > creating index paths *to save cycles*, but see no way of making

Re: index paths and enable_indexscan

2020-04-14 Thread Tom Lane
Amit Langote writes: > I am saying that instead of building index path with disabled cost, > just don't build it at all. A base rel will always have a sequetial > path, even though with disabled cost if enable_seqscan = off. Awhile back I'd looked into getting rid of disable_cost altogether by di

Re: index paths and enable_indexscan

2020-04-14 Thread Amit Langote
On Tue, Apr 14, 2020 at 6:12 PM Andy Fan wrote: > On Tue, Apr 14, 2020 at 4:58 PM Amit Langote wrote: >> I am saying that instead of building index path with disabled cost, >> just don't build it at all. A base rel will always have a sequetial >> path, even though with disabled cost if enable_seq

Re: index paths and enable_indexscan

2020-04-14 Thread Andy Fan
On Tue, Apr 14, 2020 at 5:12 PM Andy Fan wrote: > > > On Tue, Apr 14, 2020 at 4:58 PM Amit Langote > wrote: > >> On Tue, Apr 14, 2020 at 5:29 PM Andy Fan >> wrote: >> > On Tue, Apr 14, 2020 at 3:40 PM Amit Langote >> wrote: >> >> On Tue, Apr 14, 2020 at 4:13 PM Richard Guo >> wrote: >> >> > O

Re: index paths and enable_indexscan

2020-04-14 Thread Andy Fan
On Tue, Apr 14, 2020 at 4:58 PM Amit Langote wrote: > On Tue, Apr 14, 2020 at 5:29 PM Andy Fan wrote: > > On Tue, Apr 14, 2020 at 3:40 PM Amit Langote > wrote: > >> On Tue, Apr 14, 2020 at 4:13 PM Richard Guo > wrote: > >> > On Tue, Apr 14, 2020 at 2:44 PM Amit Langote > wrote: > >> >> Maybe

Re: index paths and enable_indexscan

2020-04-14 Thread Amit Langote
On Tue, Apr 14, 2020 at 5:29 PM Andy Fan wrote: > On Tue, Apr 14, 2020 at 3:40 PM Amit Langote wrote: >> On Tue, Apr 14, 2020 at 4:13 PM Richard Guo wrote: >> > On Tue, Apr 14, 2020 at 2:44 PM Amit Langote >> > wrote: >> >> Maybe I am missing something obvious, but is it intentional that >> >>

Re: index paths and enable_indexscan

2020-04-14 Thread Andy Fan
On Tue, Apr 14, 2020 at 3:40 PM Amit Langote wrote: > On Tue, Apr 14, 2020 at 4:13 PM Richard Guo > wrote: > > On Tue, Apr 14, 2020 at 2:44 PM Amit Langote > wrote: > >> Maybe I am missing something obvious, but is it intentional that > >> enable_indexscan is checked by cost_index(), that is, *

Re: index paths and enable_indexscan

2020-04-14 Thread Amit Langote
On Tue, Apr 14, 2020 at 4:13 PM Richard Guo wrote: > On Tue, Apr 14, 2020 at 2:44 PM Amit Langote wrote: >> Maybe I am missing something obvious, but is it intentional that >> enable_indexscan is checked by cost_index(), that is, *after* creating >> an index path? I was expecting that if enable_

Re: index paths and enable_indexscan

2020-04-14 Thread Richard Guo
On Tue, Apr 14, 2020 at 2:44 PM Amit Langote wrote: > Hi, > > Maybe I am missing something obvious, but is it intentional that > enable_indexscan is checked by cost_index(), that is, *after* creating > an index path? I was expecting that if enable_indexscan is off, then > no index paths would be

index paths and enable_indexscan

2020-04-13 Thread Amit Langote
Hi, Maybe I am missing something obvious, but is it intentional that enable_indexscan is checked by cost_index(), that is, *after* creating an index path? I was expecting that if enable_indexscan is off, then no index paths would be generated to begin with, because I thought they are optional. -