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: Weird performance drop
Date: Thu, 29 Mar 2007 20:56:07 +0200
Message-ID: <200703292056.08459.Vincenzo.Romano@gmail.com> (raw)

Hi all.

I'm running PostgreSQL v8.1.8 (under Linux Ubuntu).

A function body is written as "language sql stable". There is just a select
for a search in a view with two arguments to do the search. The search is done
with equality comparisons.
Both the function call and the select alone run very fast thanks to the
indexes on the right columns I presume.

Then I create a twin function where part of the comparison is done with
the "like" operator on one of the very same columns as the previous case.
While the function call is very slow, the select alone runs almost as fast
as in the case of equality comparison.

I thought that the query planner usually did a bad job on function bodies
because they'd appear opaque to it.
In this case it seems to me that the body is opaque only if I use the "like"
operator.

Any hint?

-- 
Vincenzo Romano
----
Maybe Computers will never become as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1987]



view thread (5+ messages)  latest in thread

Message-ID: <200703292056.08459.Vincenzo.Romano@gmail.com>
Permalink:  ../200703292056.08459.Vincenzo.Romano@gmail.com/
Also on:    postgresql.org/message-id/200703292056.08459.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: Weird performance drop
  In-Reply-To: <200703292056.08459.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