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

X-Received by 10.224.175.65 with SMTP id w1mr4334125qaz.7.1358163545955; Mon, 14 Jan 2013 03:39:05 -0800 (PST)
Received by 10.49.62.164 with SMTP id z4mr15330302qer.34.1358163545874; Mon, 14 Jan 2013 03:39:05 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!p13no1736309qai.0!news-out.google.com!k2ni225qap.0!nntp.google.com!p13no1736301qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.databases.postgresql
Date Mon, 14 Jan 2013 03:39:05 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=194.158.39.146; posting-account=inpwAgoAAABtA249t0vpNovr5yIjIVox
NNTP-Posting-Host 194.158.39.146
User-Agent G2/1.0
MIME-Version 1.0
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
Injection-Date Mon, 14 Jan 2013 11:39:05 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.databases.postgresql:431

Show key headers only | 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