Skip site navigation (1) Skip section navigation (2)

Re: Should changing offset in LIMIT change query plan (at all/so early)?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <goran(dot)gugic(at)gmail(dot)com>,<pgsql-performance(at)postgresql(dot)org>
Subject: Re: Should changing offset in LIMIT change query plan (at all/so early)?
Date: 2010-11-21 15:44:21
Message-ID: 4CE8E9F70200002500037C8D@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-performance
goran  wrote:
 
> Trying to understand why query planer changes the plan from
> effective one to ineffective one when I change the offset in the
> LIMIT. Also, thankfully accepting RTFM pointers to the actual FMs.
 
The query planner will consider offset and limit clauses when
estimating the cost of each plan.  The optimal plan will shift as
more tuples need to be read.  If the plan is not shifting at the
right point, it probably means that you need to tune the costing
factors used by the planner.
 
You didn't report enough information for me to suggest any particular
change; if you follow up, please review the suggested information to
post:
 
http://wiki.postgresql.org/wiki/SlowQueryQuestions
 
In particular, information about the hardware and your
postgresql.conf settings would help.
 
You might also want to review this page and see if you can tune
things.
 
http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server
 
In particular, effective_cache_size, random_page_cost, and
seq_page_cost would be likely to need adjustment based on what you've
told us; however, it might pay to review the whole configuration.
 
-Kevin

pgsql-performance by date

Next:From: tvDate: 2010-11-21 15:56:59
Subject: Re: Query Performance SQL Server vs. Postgresql
Previous:From: tvDate: 2010-11-21 15:42:07
Subject: Re: Query Performance SQL Server vs. Postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group