Weird performance drop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux