Re: Strange Index behavior

From: Együd Csaba (Freemail) <csegyud(at)freemail(dot)hu>
To: 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 'Együd Csaba' <csegyud(at)vnet(dot)hu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Strange Index behavior
Date: 2004-12-22 17:44:00
Message-ID: 0I9400GDXX99TI@mail.vnet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

But why? I thought the planner is for choose the quicker way to the target
point. If there is an index which is probably would speed up the query then
why does the planner ignore that?

The difference between the result times is 16x. I can't understand why the
planner thinks it is the better way...

-- Csaba

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, December 22, 2004 6:34 PM
To: Együd Csaba (Freemail)
Cc: 'Együd Csaba'; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Strange Index behavior

=?iso-8859-2?Q?Egy=FCd_Csaba_=28Freemail=29?= <csegyud(at)freemail(dot)hu> writes:
> The point is that there are cases where a primary key index is not
> used - even if the condition is formaly good.

You haven't actually shown us such a case. In the case you gave, I think
the planner probably made the right choice not to use the index.

regards, tom lane

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.3 - Release Date: 2004.12.21.

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.3 - Release Date: 2004.12.21.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.3 - Release Date: 2004.12.21.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.3 - Release Date: 2004.12.21.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-12-22 17:45:21 Re: default index created for primary key
Previous Message Lonni J Friedman 2004-12-22 17:41:37 Re: What HW / OS is recommeded