Prepared query parsing much slower in 9.0?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Prepared query parsing much slower in 9.0?
Date: 2010-04-06 05:32:36
Message-ID: 4BBAC774.508@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

All,

Wheeler has been doing some head-to-head performance testing of
Bricolage performance on 8.4 vs. 9.0. So far, 9.0 has been slower, and
I've been trying to track down the particular areas where it is.

One appears to be prepared query parsing. One test of the Bricolage
test suite creates 89 new prepared queries.

9.0's median parse time is 30% slower than 8.4 ( .2ms vs. .134ms). More
seriously, the top 3 slowest parses take 900% as much time as they do on
8.4, and account for 50% of overall prepared query parsing time. Those
appear to be these queries, although the pg_log makes it hard to relate
a parse to what query is being prepared:

execute dbdpg_p81932_1: SELECT u.id, u.login, u.password,
u.active, p.prefix, p.fname, p.mname, p.lname, p.suffix, p.active,
m.grp__id, 1 FROM person p, usr u, member m, user_member c
WHERE p.id = u.id AND u.id = c.object_id AND c.member__id = m.id
AND m.active = '1' AND u.id = $1 ORDER BY LOWER(p.lname),
LOWER(p.fname), LOWER(p.mname), u.id

execute dbdpg_p81932_2: SELECT DISTINCT a.id FROM
site a, member m, site_member c WHERE a.id = c.object_id AND
c.member__id = m.id AND m.active = '1' AND LOWER(a.name) LIKE LOWER($1)
ORDER BY a.id

execute dbdpg_p81932_27: DELETE FROM org WHERE id > 1

--
-- Josh Berkus
PostgreSQL Experts Inc.
http://www.pgexperts.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2010-04-06 05:47:02 SELECT constant; takes 15x longer on 9.0?
Previous Message Takahiro Itagaki 2010-04-06 05:29:33 Re: Compile fail, alpha5 & gcc 4.3.3 in elog.c