pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vincenzo Romano <vincenzo.romano@gmail.com>
To: pgsql-performance@postgresql.org
Subject: function call vs staright query
Date: Sun, 18 Mar 2007 07:50:54 +0100
Message-ID: <200703180750.54703.Vincenzo.Romano@gmail.com> (raw)

Hi all.

I'm experiencing a strange behaviour with 8.1.8 (cannot do upgrades to 8.2 at
the moment).

On a 13+ million rows table I can do a query with results back in less than
100 ms. Result is a set of bigint.
But when I encapsulate that query into an "SQL" function with three parameters
the results come back in about one minute. The function contains just the same
query as above.
Of course there's been no change in indices or even into the table itself
between the two tests.

I'm almost sure I'm missing something, but have no clue about what!
Any hint?



view thread (4+ messages)  latest in thread

Message-ID: <200703180750.54703.Vincenzo.Romano@gmail.com>
Permalink:  ../200703180750.54703.Vincenzo.Romano@gmail.com/
Also on:    postgresql.org/message-id/200703180750.54703.Vincenzo.Romano@gmail.com

 · 

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-performance@postgresql.org
  Cc: vincenzo.romano@gmail.com
  Subject: Re: function call vs staright query
  In-Reply-To: <200703180750.54703.Vincenzo.Romano@gmail.com>

* 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