Re: pl/pgsql faster than raw SQL?

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: John A Meinel <john(at)arbash-meinel(dot)com>
Cc: Gaetano Mendola <mendola(at)bigfoot(dot)com>, Markus Bertheau ☭ <twanger(at)bluetwanger(dot)de>, pgsql-performance(at)postgresql(dot)org
Subject: Re: pl/pgsql faster than raw SQL?
Date: 2005-03-09 11:20:57
Message-ID: 422EDC19.4080105@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> That sounds more like you had bad statistics on the field1 column, which
> caused postgres to switch from a seqscan to an index scan, only there
> were so many rows with field1='New' that it actually would have been
> faster with a seqscan.

The field1 was a calculated field and with the filter "='New'"
postgres was executing that function on more rows than without filter.

Regards
Gaetano Mendola

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCLtwZ7UpzwH2SGd4RAhU5AJwMeFWwIO/UfdU0QTDo+FTCxPhqYACfYNVl
1yBUEObhZhUDnNDXdsJ/bi0=
=xc8U
-----END PGP SIGNATURE-----

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Gaetano Mendola 2005-03-09 11:27:30 Re: vacuum full, why multiple times ?
Previous Message Josh Berkus 2005-03-09 07:00:46 Re: Why would writes to pgsql_tmp bottleneck at 1mb/s?