Re: Re: Query not using index

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Re: Query not using index
Date: 2001-05-10 23:47:13
Message-ID: 200105102347.f4ANlDv06875@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Is there a good reason why rdbms don't just keep a cache of decisions on
> this stuff. I realise SQL is supposed to be ad-hoc but in reality, it's the
> old 90:10 rule where a handful of queries get run consistently and where
> performance is important.
>
> Why doesn't PG (or any other system afaik) just have a first guess, run the
> query and then if the costs are horribly wrong cache the right result. I'm
> guessing there's a bloody good reason (TM) for it since query planning has
> got to be equivalent to least-cost path so NP (NP-Complete? I forget - too
> long out of college).

I have asked about this before. Decisions about sequential/index scans
could be theoretically fed from the executor back to the optimizer for
later user.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Waugh 2001-05-11 01:22:13 Passing composite types to plpgsql functions
Previous Message Tom Lane 2001-05-10 23:27:54 Re: Re: Query not using index