Re: [GENERAL] Query with large in clauses uses a lot of memory

2016-11-28 Thread greigwise
Wow. Thanks for the prompt answer. As a follow-up I was wondering if maybe there would be a way to tell it to NOT try to plan/execute the query (and instead throw an error) if the memory usage exceeded X. Thanks again. Greig -- View this message in context: http://postgresql.nabble.com/Quer

Re: [GENERAL] Query with large in clauses uses a lot of memory

2016-11-23 Thread Tom Lane
greigwise writes: > So, I decided to try an experiment. I wrote 2 queries as follows: > 1 ) select pg_sleep(100) ; > 2 ) with q (s1, s2) as (select pg_sleep(100), 1) > select * from q where s2 in ( 1, delimited numbers>) > > It looks to me like the connection running the big query is usi