Skip site navigation (1) Skip section navigation (2)

Re: function runs slow

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: function runs slow
Date: 2010-07-16 00:26:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
A. Kretschmer wrote:
> In response to Charles Holleran :
>> Why is it slow when the same un-functionized query was fast?  The tbl_a has
>> est. 30,000,000 records.  It has an index for (x,y) pairs.  It has an index for
>> date_observed.  So good results on the straight query.  Where did I go wrong
>> with the function? 
> The planner isn't able to choose the right plan because he don't know
> the actual parameters.

That is precisely why I asked about the values for the bind variables. 
Unfortunately, there is no facility that could influence the plan in 
this case. Constant re-parsing will, of course, be grossly suboptimal.

Mladen Gogala 
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251 

In response to

pgsql-novice by date

Next:From: lee cDate: 2010-07-16 03:54:54
Subject: initial password
Previous:From: Tovo J. RABEMANANTSOADate: 2010-07-15 12:57:36
Subject: Re: [SOLVED]Could not start server

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group