pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Ray <rray@mstc.state.ms.us>
To: pgsql-sql@postgresql.org
Subject: Re: Query is fast and function is slow
Date: Thu, 7 Dec 2006 11:10:56 -0600 (CST)
Message-ID: <Pine.LNX.4.64.0612071100530.16909@rray.drdc.mstc.ms.gov> (raw)
In-Reply-To: <16166.1165509626@sss.pgh.pa.us>
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>
	<16166.1165509626@sss.pgh.pa.us>

On Thu, 7 Dec 2006, Tom Lane wrote:

> 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.

I said my knowledge was pitiful
Changing both parameters to char(9) and name fixed the problem
It appears to be using the index
If time allows could you explain this a bit

Thanks
Richard

>
> 			regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
>



view thread (7+ messages)  latest in thread

Message-ID: <Pine.LNX.4.64.0612071100530.16909@rray.drdc.mstc.ms.gov>
Permalink:  ../Pine.LNX.4.64.0612071100530.16909@rray.drdc.mstc.ms.gov/
Also on:    postgresql.org/message-id/Pine.LNX.4.64.0612071100530.16909@rray.drdc.mstc.ms.gov

 · 

reply

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: rray@mstc.state.ms.us
  Subject: Re: Query is fast and function is slow
  In-Reply-To: <Pine.LNX.4.64.0612071100530.16909@rray.drdc.mstc.ms.gov>

* 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