Query slow for new participants - Mailing list pgsql-performance

From Kim
Subject Query slow for new participants
Date
Msg-id 1551091278468-0.post@n3.nabble.com
Whole thread Raw
Responses Re: Query slow for new participants  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-performance
Hello,

I have an article query which returns articles enabled for a participant.
Article table – Participant table – Table in between which stores the links
between the Article and particitpant including characteristics such as
enabled.
It is possible to search on the articles by number, description,…
For all of my participants, the articles are return in up to 3 seconds.
However, when I add a new participant, which has in fact very few articles
enabled, the query takes up to 30 seconds.
When running analyse explain, I can see that the execution plan for all
participants uses indexes and joins the table in the same order.
For the new participant, also indexes are used, but the tables are joined in
a different order which makes the query very slow.
Is there any way how I can make the queries fast for new participants? This
is a big problem, because for new participants, speed is even more
important.

Thank you for your help.




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html


pgsql-performance by date:

Previous
From: Tobias Gierke
Date:
Subject: Idle backends outside a transaction holding onto large amounts ofmemory / swap space?
Next
From: Pavel Stehule
Date:
Subject: Re: Idle backends outside a transaction holding onto large amounts ofmemory / swap space?