Re: [PERFORM] Slow query question

2016-12-07 Thread Andrey Povazhnyi
Tom, Thank you for a thorough answer. We’ll try the 2-column index. Regards, Andrey Povazhnyi > On Dec 6, 2016, at 6:33 PM, Tom Lane wrote: > > Andrey Povazhnyi writes: >> We’ve got a strange planner behavior on a query to one of our bigger tables >> after we upgraded to postgres 9.6.1 recen

Re: [PERFORM] Slow query question

2016-12-06 Thread Tom Lane
Andrey Povazhnyi writes: > We’ve got a strange planner behavior on a query to one of our bigger tables > after we upgraded to postgres 9.6.1 recently. The basic problem with this query is that there are no good alternatives. The planner believes there are about 53K rows matching the WHERE condit

[PERFORM] Slow query question

2016-12-06 Thread Andrey Povazhnyi
Hello, List. We’ve got a strange planner behavior on a query to one of our bigger tables after we upgraded to postgres 9.6.1 recently. The table (schema here http://pastebin.com/nRAny4bw ) has 28m+ rows and is used to store chat messages for different chat rooms (s