Re: Re: Query not using index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Jones <chris(at)mt(dot)sri(dot)com>
Cc: ryan(at)paymentalliance(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: Re: Query not using index
Date: 2001-05-10 21:43:15
Message-ID: 25265.989530995@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Jones <chris(at)mt(dot)sri(dot)com> writes:
>> Ah. You must have a few values that are far more frequent (like tens of
>> thousands of occurrences?) and these are throwing off the planner's
>> statistics.

> I had a similar situation, where I had a lot of rows with 0's in
> them. Changing those to NULLs worked wonders.

Yes, if you have a lot of "dummy" values it's a good idea to represent
them as NULLs rather than some arbitrarily-chosen regular data value.
The planner does keep track of NULLs separately from everything else.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2001-05-10 23:07:09 Re: Distributed join query ?
Previous Message Chris Jones 2001-05-10 21:34:18 Re: Re: Query not using index