cost of parse/plan/execute for one sample query

From: Barry Lind <barry(at)xythos(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: cost of parse/plan/execute for one sample query
Date: 2002-04-14 04:16:02
Message-ID: 3CB90282.1070908@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In benchmarks that I have done in the past comparing performance of
Oracle and Postgres in our web application, I found that I got ~140
requests/sec on Oracle and ~50 requests/sec on postgres.

The code path in my benchmark only issues one sql statement. Since I
know that Oracle caches query plans, I wanted to see the cost under
postgres of the parse/plan/execute to see if the parsing and planing of
the sql statement would account for the difference in performance
between Oracle and postgres.

In a recent mail note to hackers, Tom mentioned the existence of the
show_parser_stats, show_planner_stats, and show_executor_stats
parameters in the postgresql.conf file. So I turned them on ran my
query a few times and here are the results:

average of 10 runs:
parsing = .003537 sec (19.3%)*
planning = .009793 sec (53.5%)
execute = .004967 sec (27.2%)

If Oracle is only incurring the execute cost for each query then this
would explain the difference in performance between Oracle and Postgres.

This would lead me to conclude that the current proposed PREPARE/EXECUTE
patch will be very useful to me. (now I just need to find the time to
test it).

thanks,
--Barry

* show_parser_stats prints out three separate timings: parser
statistics, parse analysis statistics, rewriter statistics, the number
.003537 is the sum of those three (.001086 + .002350 + .000101)

Attachment Content-Type Size
test.sql text/plain 2.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2002-04-14 04:36:38 Re: experimental pg_qcache patch
Previous Message Christopher Kings-Lynne 2002-04-14 04:11:31 Re: experimental pg_qcache patch