embedded sql regression from 8.2.4 to 8.3.7

From: "Haszlakiewicz, Eric" <EHASZLA(at)transunion(dot)com>
To: <pgsql-performance(at)postgresql(dot)org>
Subject: embedded sql regression from 8.2.4 to 8.3.7
Date: 2009-07-09 16:31:24
Message-ID: 9D29FD18CBD74A478CBA86E6EF6DBAD403DBB05A@CHI4EVS04.corp.transunion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


I noticed a bit of a performance regression in embedded sql queries when
moving from the client libraries in verison 8.2.4 to 8.3.7. My
application does a whole lot of queries, many of which don't return any
data. When we moved to the new libraries the time of running a query
(from the application point of view) went from about 550 usec to 800
usec. In both cases this was against a server running 8.3.7.
I turned on log_statement_stats and noticed that the behaviour is
slightly different, and the 8.3.7 version sends the statement to the
server twice, while 8.2.4 only sends it once.

const char *SQL_text = "select * from foo"; (not always the same
query)
exec sql prepare s_1ab from :SQL_text; <---- [*1]
exec sql declare c_1ab cursor for s_1ab;
exec sql open c_1ab; <---- [*2]

At [*1], with the 8.3.7 libraries, I see in the server log:
STATEMENT: select * from foo

With 8.2.4, nothing is logged. Both versions send the statement to
declare the cursor:
STATEMENT: declare c_1ab cursor for select * from foo

Suggestions?

eric

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-07-09 16:35:01 Re: Sorting by an arbitrary criterion
Previous Message Craig James 2009-07-09 16:26:42 Sorting by an arbitrary criterion