Re: Re: Query not using index - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Re: Query not using index
Date
Msg-id 200105102347.f4ANlDv06875@candle.pha.pa.us
Whole thread Raw
In response to Re: Re: Query not using index  ("Richard Huxton" <dev@archonet.com>)
List 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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: Query not using index
Next
From: ryan@paymentalliance.net
Date:
Subject: Re: Query not using index