Re: SELECT performance drop

2019-01-24 Thread Jan Nielsen
With Pascal's suggestion, I added a new index: CREATE INDEX fm_order_sid_type_idx ON fm_order (session_id, type); which improved the query to 2mS! https://explain.depesz.com/s/oxvs Thank you, Pascal! On Thu, Jan 24, 2019 at 9:52 AM Jan Nielsen wrote: > > > On Wed, Jan 23, 2019 at 12:37

Re: SELECT performance drop

2019-01-24 Thread Jan Nielsen
On Wed, Jan 23, 2019 at 12:37 PM legrand legrand < legrand_legr...@hotmail.com> wrote: > Hi, > is there an index on > fm_order(session_id,type)? > There isn't at the moment: table_name | index_name | column_name +--+

Re: SELECT performance drop

2019-01-23 Thread Laurenz Albe
On Wed, 2019-01-23 at 10:28 -0700, Jan Nielsen wrote: > select > order0_.id as id1_7_, > order0_.created_by as created_2_7_, > order0_.created_date as created_3_7_, > order0_.last_modified_by as last_mod4_7_, > order0_.last_modified_date as last_mod5_7_,

Re: SELECT performance drop

2019-01-23 Thread Jan Nielsen
On Wed, Jan 23, 2019 at 6:51 AM Jim Finnerty wrote: > One thing that isn't helping is that you have a redundant predicate. The > selectivity of this predicate is also estimated too low, so removing the > redundant predicate might improve the estimate and change the plan: > > (

Re: SELECT performance drop

2019-01-22 Thread Jan Nielsen
On Tue, Jan 22, 2019 at 2:55 PM legrand legrand wrote: > Hello, > could you check that statistics for fm_session are accurate ? > > Regards > PAscal > heroku pg:psql -c "SELECT schemaname, relname, last_analyze FROM pg_stat_all_tables WHERE relname LIKE 'fm_%'" schemaname |relname | last

Re: SELECT performance drop

2019-01-22 Thread legrand legrand
Hello, could you check that statistics for fm_session are accurate ? Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html

Re: SELECT performance drop

2019-01-22 Thread Jan Nielsen
On Tue, Jan 22, 2019 at 1:04 PM Jan Nielsen wrote: > I just notice that one of my Hibernate JPA SELECTs against my Heroku PG > 10.4 instance is taking a l o o o g to complete > as this EXPLAIN (ANALYZE, BUFFERS) > shows. The database is 591MB running in PG 10

SELECT performance drop

2019-01-22 Thread Jan Nielsen
I just notice that one of my Hibernate JPA SELECTs against my Heroku PG 10.4 instance is taking a l o o o g to complete as this EXPLAIN (ANALYZE, BUFFERS) shows. The database is 591MB running in PG 10.4 on Heroku with the following row counts and index use: