Unix Technical Forum

Query Analyser

This is a discussion on Query Analyser within the Pgsql Performance forums, part of the PostgreSQL category; --> Hi List, Is there anyway so as to indicate the Query Analyser not to use the plan which it ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 11:10 AM
Gauri Kanekar
 
Posts: n/a
Default Query Analyser

Hi List,

Is there anyway so as to indicate the Query Analyser not to use the
plan which it is using regularly, and use a new plan ?

From where do the Query Analyser gets the all info to prepare a plan?
Is it only from the pg_statistics table or are there anyother tables
which have this info. stored?

And can we change the statistic??

Thanx in advance
--
Regards
Gauri

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 11:10 AM
=?iso-8859-1?q?Rodrigo_De_Le=F3n?=
 
Posts: n/a
Default Re: Query Analyser

On Jul 10, 9:47 am, meetgaurikane...@gmail.com ("Gauri Kanekar")
wrote:
> From where do the Query Analyser gets the all info to prepare a plan?


See:
http://www.postgresql.org/docs/8.2/s...g-explain.html
http://www.postgresql.org/docs/8.2/s...ner-stats.html
http://www.postgresql.org/docs/8.2/s...s-details.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 11:11 AM
Michael Fuhr
 
Posts: n/a
Default Re: Query Analyser

On Tue, Jul 10, 2007 at 08:17:05PM +0530, Gauri Kanekar wrote:
> Is there anyway so as to indicate the Query Analyser not to use the
> plan which it is using regularly, and use a new plan ?


You can't dictate the query plan but you can influence the planner's
decisions with various configuration settings.

http://www.postgresql.org/docs/8.2/i...fig-query.html

Disabling planner methods (enable_seqscan, etc.) should be a last
resort -- before doing so make sure that settings like shared_buffers
and effective_cache_size are appropriately sized for your system,
that you're gathering enough statistics (see below), and that the
statistics are current (run ANALYZE or VACUUM ANALYZE). After all
that, if you still think you need to disable a planner method then
consider posting the query and the EXPLAIN ANALYZE output to
pgsql-performance to see if anybody has other suggestions.

> From where do the Query Analyser gets the all info to prepare a plan?
> Is it only from the pg_statistics table or are there anyother tables
> which have this info. stored?


The planner also uses pg_class.{reltuples,relpages}.

http://www.postgresql.org/docs/8.2/i...ner-stats.html
http://www.postgresql.org/docs/8.2/i...s-details.html

> And can we change the statistic??


You can increase the amount of statistics gathered for a specific
column with ALTER TABLE SET STATISTICS or system-wide by adjusting
default_statistics_target.

http://www.postgresql.org/docs/8.2/i...ltertable.html
http://www.postgresql.org/docs/8.2/i...IG-QUERY-OTHER

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:00 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com