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

Re: =?iso-8859-2?B?T2Rwb3bs7zog?=Re: backend don't use index when querying by indexed column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: zhabala(at)telecom(dot)cz
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: =?iso-8859-2?B?T2Rwb3bs7zog?=Re: backend don't use index when querying by indexed column
Date: 2001-08-07 13:33:24
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
<zhabala(at)telecom(dot)cz> writes:
> first of all thank You for Your response. But here is the
> reality. Table formula have about 450000 rows at this time.
> The id_formula column is int4 defined as not null primary key.

It is eh?  Have you done a VACUUM ANALYZE on this table lately?
4500 rows (1%) would be the default match estimate in the absence of
any statistics.

> And the index have clause unique, but backend still don't use it.

7.2 will know enough to realize that presence of a unique index means
the column is unique, but existing releases only look at the VACUUM
ANALYZE statistics.  No statistics = bad plan.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2001-08-07 17:40:31
Subject: Re: v7.0.2: can't use 'EXTRACT(EPOCH FROM'
Previous:From: pgsql-bugsDate: 2001-08-07 10:20:49
Subject: ecpg: unstable INSERT operation

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