Re: Query not using index

From: ryan(at)paymentalliance(dot)net
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query not using index
Date: 2001-05-10 19:10:58
Message-ID: 3afae78f.296681946@paymentalliance.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You and Stephan hit it right on the nose - our table has been
maliciously propagated with thousands of faulty values - once gone
index are in use and DB is SPEEDING along 8)

Thanks for your help!!!

-r

On Thu, 10 May 2001 21:49:28 +0000 (UTC), in
comp.databases.postgresql.general you wrote:

>--w2JjAQZceEVGylhD
>Content-Type: text/plain; charset=us-ascii
>Content-Disposition: inline
>Content-Transfer-Encoding: quoted-printable
>
>On Thu, May 10, 2001 at 05:22:07PM -0400, Tom Lane wrote:
>
>> ryan(at)paymentalliance(dot)net writes:
>> > No the query usually returns between 0 and 5 rows. Usually not zero -
>> > most often 1.
>>=20
>> 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. The planner (or
>statistics gatherer, or something) apparently takes notice of the
>distribution of non-NULL values.
>
>Chris
>
>--=20
>chris(at)mt(dot)sri(dot)com -----------------------------------------------------
>Chris Jones SRI International, Inc.
> www.sri.com
>
>--w2JjAQZceEVGylhD
>Content-Type: application/pgp-signature
>Content-Disposition: inline
>
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.0.4 (NetBSD)
>Comment: For info see http://www.gnupg.org
>
>iEYEARECAAYFAjr7CVoACgkQ4nX8TnrnU2+p0ACaAoSNEtwIlibMlh+H9ehJecmy
>lBcAnjI0TYJubbSIwgzi8DuRxoos4OwT
>=edfw
>-----END PGP SIGNATURE-----
>
>--w2JjAQZceEVGylhD
>Content-Type: text/plain
>Content-Disposition: inline
>Content-Transfer-Encoding: binary
>MIME-Version: 1.0
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>--w2JjAQZceEVGylhD--

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dominic J. Eidson 2001-05-10 19:27:20 Re: my connections never die
Previous Message Patrick Welche 2001-05-10 18:51:46 Re: very odd behavior