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

Weird performance drop

From: Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Weird performance drop
Date: 2007-03-29 18:56:07
Message-ID: 200703292056.08459.Vincenzo.Romano@gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
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]

Responses

pgsql-performance by date

Next:From: Erik JonesDate: 2007-03-29 18:58:13
Subject: Re: Shared buffers, db transactions commited, and write IO on Solaris
Previous:From: dimitri kDate: 2007-03-29 17:41:05
Subject: Re: Shared buffers, db transactions commited, and write IO on Solaris

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