Re: Index working, but not inside function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Patrick(dot)Clery(at)gmail(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Index working, but not inside function
Date: 2007-07-10 17:24:24
Message-ID: 2511.1184088264@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Patrick Clery <Patrick(dot)Clery(at)gmail(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2007-07-10 18:06:10 Re: Database system identifier from SQL
Previous Message Tom Lane 2007-07-10 15:23:19 Re: Database system identifier from SQL