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

Re: Forcing index scan on query produces 16x faster

From: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
To: Christian Brink <cbrink(at)r-stream(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Forcing index scan on query produces 16x faster
Date: 2010-03-17 21:56:55
Message-ID: e7f9235d1003171456q5d905234o85a1843f7a196218@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, Mar 17, 2010 at 5:25 PM, Christian Brink <cbrink(at)r-stream(dot)com>wrote:

>
>               ->  Index Scan using sales_tranzdate_index on sales s
>  (cost=0.01..1825.27 rows=22530 width=12) (actual time=0.072..3.464 rows=225
> loops=1)
>

Have you tried increasing the statistics on that table (and then analyzing)?
The estimates for that index scan are off by a factor of 100, which may
indicate why the planner is trying so hard to avoid a nestloop there.

-- 
- David T. Wilson
david(dot)t(dot)wilson(at)gmail(dot)com

In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2010-03-17 22:04:25
Subject: Re: Forcing index scan on query produces 16x faster
Previous:From: Christian BrinkDate: 2010-03-17 21:25:35
Subject: Forcing index scan on query produces 16x faster

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