Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #431

Query slow in function but not in normal query window

Newsgroups comp.databases.postgresql
Date 2013-01-14 03:39 -0800
Message-ID <5d79dd44-e7d2-4e65-9661-fb6dd337f610@googlegroups.com> (permalink)
Subject Query slow in function but not in normal query window
From ivan.sammut@credorax.com

Show all headers | View raw


Hi ppl,

  I have a function which returns a number of transactions which fall between 2 dates and when I run this in a normal query window it is quite fast (40 secs maximum). But when I put the same query in a function and the dates are passed to the query as parameters the function will take more than 4 minutes as if the query is not using an indexing. 

Anyone had the same problem or has any idea?

Thanks
Ivan

Back to comp.databases.postgresql | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Query slow in function but not in normal query window ivan.sammut@credorax.com - 2013-01-14 03:39 -0800
  Re: Query slow in function but not in normal query window Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 2013-01-14 22:10 +0100
  Re: Query slow in function but not in normal query window Ralf Döblitz <doeblitz@doeblitz.net> - 2013-01-14 18:15 +0000
  Re: Query slow in function but not in normal query window Jasen Betts <jasen@xnet.co.nz> - 2013-01-15 07:39 +0000

csiph-web