Query slow for new participants

From: Kim <support(at)mekong(dot)be>
To: pgsql-performance(at)postgresql(dot)org
Subject: Query slow for new participants
Date: 2019-02-25 10:41:18
Message-ID: 1551091278468-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2019-02-25 10:52:10 Re: Idle backends outside a transaction holding onto large amounts of memory / swap space?
Previous Message Tobias Gierke 2019-02-25 10:36:40 Idle backends outside a transaction holding onto large amounts of memory / swap space?