dbTalk Databases Forums  

postgres 8.2, is there a way to force an execution plan ?

comp.databases.postgresql comp.databases.postgresql


Discuss postgres 8.2, is there a way to force an execution plan ? in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Patrox
 
Posts: n/a

Default postgres 8.2, is there a way to force an execution plan ? - 09-10-2007 , 10:41 AM






hi !
I would like to know if with Postgres 8.2 is there any way to force a
query execution plan ?
For example to use a specific index at a speciifc moment during the
execution ?
This possibilty exists within oracle with the /*+ blabla*/ hints which
can be written inside one's query since ages.
I'm eager to find the same possibility with Postgres ...
Any idea about that ?
thx !
Regards,
P.

Reply With Quote
  #2  
Old   
Lew
 
Posts: n/a

Default Re: postgres 8.2, is there a way to force an execution plan ? - 09-10-2007 , 06:17 PM






Patrox wrote:
Quote:
hi !
I would like to know if with Postgres 8.2 is there any way to force a
query execution plan ?
For example to use a specific index at a speciifc moment during the
execution ?
This possibilty exists within oracle with the /*+ blabla*/ hints which
can be written inside one's query since ages.
I'm eager to find the same possibility with Postgres ...
Any idea about that ?
This is better asked at, say, pgsql.general (a moderated newsgroup),

There are statistics variables in Postgres that tell the query planner the
relative costs of things like a page fetch, a sort and so on. Generally,
though, tweaking the planner causes a degradation of performance, since it's
pretty good at telling when the overhead of an index is going to overtake the
overhead of, say, a table scan. This depends on factors like how selective
the index is; an index on a uniformly distributed boolean value is unlikely to
help much, for example. The ability of the planner to tell how selective an
index is, or how long a table scan might take, is dependent on how good its
statistics are for the tables under query. This in turn depends on good DBA
practices, like running a frequent VACUUM ANALYZE.

I'll bet you ten credits that your hand-tweaked plan runs worse than PG's
planner would come up with if the statistics were accurate, and twenty that
it's no better.

--
Lew


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.