From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Ray <rray@mstc.state.ms.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Query is fast and function is slow
Date: Thu, 07 Dec 2006 11:40:26 -0500
Message-ID: <16166.1165509626@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.64.0612070826040.16909@rray.drdc.mstc.ms.gov>
References: <Pine.LNX.4.64.0612060934410.15200@rray.drdc.mstc.ms.gov>
<200612071053.01287.mlists@rp-online.de>
<Pine.LNX.4.64.0612070826040.16909@rray.drdc.mstc.ms.gov>
Richard Ray <rray@mstc.state.ms.us> writes:
> On Thu, 7 Dec 2006, Thomas Pundt wrote:
>> Just a guess: is the column "doc_num" really of type text? Maybe using "text"
>> in the function lets the planner choose a sequential scan?
> Actually "doc_num" is char(9)
> I changed text to char(9) and got same slow results
You need to make the second argument type "name", too, if you have a lot
of users.
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, rray@mstc.state.ms.us
Subject: Re: Query is fast and function is slow
In-Reply-To: <16166.1165509626@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