From: Tom Lane <tgl@sss.pgh.pa.us>
To: Patrick.Clery@gmail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Index working, but not inside function
Date: Tue, 10 Jul 2007 13:24:24 -0400
Message-ID: <2511.1184088264@sss.pgh.pa.us> (raw)
In-Reply-To: <200707100038.15237.Patrick.Clery@gmail.com>
References: <200707100038.15237.Patrick.Clery@gmail.com>
Patrick Clery <Patrick.Clery@gmail.com> writes:
> When I execute the function the query stalls and is apparently not taking
> advantage of the index.
Your example doesn't demonstrate any such thing; what seems more likely
is that there are a whole lot of rows matching 'United States' and so
the query takes longer than you expect. What would be convincing is
if you had actually *executed* the prepared query, on the same data not
different data, and timed that.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, Patrick.Clery@gmail.com
Subject: Re: Index working, but not inside function
In-Reply-To: <2511.1184088264@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox