Re: Query not using index - Mailing list pgsql-general

From ryan@paymentalliance.net
Subject Re: Query not using index
Date
Msg-id 3afae78f.296681946@paymentalliance.net
Whole thread Raw
In response to Re: Re: Query not using index  (Chris Jones <chris@mt.sri.com>)
List 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@paymentalliance.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@mt.sri.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--


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: Query not using index
Next
From: "Jeff Waugh"
Date:
Subject: Passing composite types to plpgsql functions