statement_timeout affects query results fetching? - Mailing list pgsql-hackers

From Shay Rojansky
Subject statement_timeout affects query results fetching?
Date
Msg-id CADT4RqCho15BE5p+RkYRkTK6oiw9uqB2Cu8m1c-KTdobLqtQUw@mail.gmail.com
Whole thread Raw
Responses Re: statement_timeout affects query results fetching?  (Robert Haas <robertmhaas@gmail.com>)
Re: statement_timeout affects query results fetching?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-hackers by date:

Previous
From: Satoshi Nagayasu
Date:
Subject: Assert in pg_stat_statements
Next
From: Andreas Seltenreich
Date:
Subject: [sqlsmith] ERROR: failed to build any %d-way joins