Re: [PERFORM] Query performance changes significantly depending on limit value

2017-02-23 Thread Pavel Stehule
2017-02-23 17:45 GMT+01:00 Rowan Seymour : > Not sure what other options we have other than an EAV approach since we > allow users to define their own attribute types (attribute type is in > contacts_contactfield, attribute value is in values_value). Would you > expect modelling that with a JSON c

Re: [PERFORM] Query performance changes significantly depending on limit value

2017-02-23 Thread Rowan Seymour
Not sure what other options we have other than an EAV approach since we allow users to define their own attribute types (attribute type is in contacts_contactfield, attribute value is in values_value). Would you expect modelling that with a JSON column to perform better? Thanks for the tips! On 2

Re: [PERFORM] Query performance changes significantly depending on limit value

2017-02-23 Thread Pavel Stehule
2017-02-23 15:02 GMT+01:00 Rowan Seymour : > Hi Pavel. That suggestion gets me as far as LIMIT 694 with the fast plan > then things get slow again. This is now what happens at LIMIT 695: > > Limit (cost=35945.78..50034.52 rows=695 width=88) (actual > time=12852.580..12854.382 rows=695 loops=1) >

Re: [PERFORM] Query performance changes significantly depending on limit value

2017-02-23 Thread Rowan Seymour
Hi Pavel. That suggestion gets me as far as LIMIT 694 with the fast plan then things get slow again. This is now what happens at LIMIT 695: Limit (cost=35945.78..50034.52 rows=695 width=88) (actual time=12852.580..12854.382 rows=695 loops=1) Buffers: shared hit=6 read=66689 -> Merge Join (c

Re: [PERFORM] Query performance changes significantly depending on limit value

2017-02-23 Thread Pavel Stehule
2017-02-23 14:11 GMT+01:00 Rowan Seymour : > Hi guys > > I'm a bit stuck on a query that performs fantastically up to a certain > limit value, after which the planner goes off in a completely different > direction and performance gets dramatically worse. Am using Postgresql 9.3 > > You can see all