statement_timeout affects query results fetching?

From: Shay Rojansky <roji(at)roji(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: statement_timeout affects query results fetching?
Date: 2015-08-08 09:31:46
Message-ID: CADT4RqCho15BE5p+RkYRkTK6oiw9uqB2Cu8m1c-KTdobLqtQUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi everyone, I'm seeing some strange behavior and wanted to confirm it.

When executing a query that selects a long result set, if the code
processing the results takes its time (i.e.g more than statement_timeout),
a timeout occurs. My expectation was that statement_timeout only affects
query *processing*, and does not cover the frontend actually processing the
result.

First, I wanted to confirm that this is the case (and not some sort of bug
in my code).

If this is the case, is this intended? Here are some points:
* It makes statement_timeout very difficult to use; clients do very diverse
things with database results, it may be very difficult (or impossible) to
estimate how much time they should take (e.g. random load factors on the
client machine or on some other machine receiving results).
* It makes it impossible to specifically detect problematic *queries* which
take too long to execute (as opposed to the time taken to process their
results).

If you do insist that this behavior is correct, a documentation update for
statement_timeout might make this clearer.

Thanks,

Shay

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Seltenreich 2015-08-08 11:04:29 [sqlsmith] ERROR: failed to build any %d-way joins
Previous Message Satoshi Nagayasu 2015-08-08 09:00:26 Assert in pg_stat_statements