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

Re: Optimizer Selecting Incorrect Index

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: David Price <dprice(at)dentfirst(dot)com>,<pgsql-performance(at)postgresql(dot)org>
Subject: Re: Optimizer Selecting Incorrect Index
Date: 2004-08-26 06:15:52
Message-ID: Pine.LNX.4.44.0408260813230.9559-100000@zigo.dhs.org (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, 25 Aug 2004, Richard Huxton wrote:

> >  Index Scan using trptserc on trans  (cost=0.00..465.10 rows=44 width=118)
> >    Index Cond: (trn_patno = 199999)
> >    Filter: ((trn_old_date >= '1994-08-23'::date) AND (trn_old_date <=
> > '2004-08-23'::date) AND (trn_bill_inc = 'B'::bpchar))
> > (687 rows)
> 
> >  Index Scan using todate on trans  (cost=0.00..105165.74 rows=1 width=143)
> >    Index Cond: ((trn_old_date >= '1994-08-23'::date) AND (trn_old_date <=
> > '2004-08-23'::date))
> >    Filter: ((trn_patno = 199999) AND (trn_bill_inc = 'B'::bpchar))
> > (713 rows)
> 
> These queries are different. The first returns 687 rows and the second 
> 713 rows.

The 687 and 713 are the number of rows in the plan, not the number of rows 
the queries return.

-- 
/Dennis Björklund


In response to

Responses

pgsql-performance by date

Next:From: Hervé PiedvacheDate: 2004-08-26 07:22:01
Subject: Re: TSearch2 and optimisation ...
Previous:From: Mark KirkwoodDate: 2004-08-26 04:51:50
Subject: Re: What is the best way to do attribute/values?

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