Re: PostgreSQL doesn't use indexes even is enable_seqscan

From: Ricardo Junior <suga(at)netbsd(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL doesn't use indexes even is enable_seqscan
Date: 2002-07-09 03:41:03
Message-ID: Pine.LNX.4.44.0207090039030.642-100000@ricardo.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi there,

> > I have a severe problem with PostgreSQL 7.2.1.
> > I have a table containing 500mio records (for testing purposes).
> > Indexes: idx_one_xmod
> > Unique keys: idx_one_id
> >
> > cluster=# SET enable_seqscan TO off;
> > SET VARIABLE
> > cluster=# SELECT * FROM one WHERE id=300000;

> You'll need to quote or explicitly cast the
> constant to bigint for the indexes to get used.
> It's a problem with the way numeric constants are
> handled. They'll get prematurely forced to int4
> if they fit, and won't promote for index use.

Perhaps this should be added to the Documentation in the indexes
part. I had the same problem last week and I guess it's a very common and
frequent question.

[]'s
Ricardo.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-09 03:45:36 Re: Odd new symptom - database locking up on a query
Previous Message Curt Sampson 2002-07-09 03:38:56 Re: WAL recycling, ext3, Linux 2.4.18