Re: Query slow for new participants

Поиск
Список
Период
Сортировка
От Michael Lewis
Тема Re: Query slow for new participants
Дата
Msg-id CAHOFxGrhyXmGe_bgY_oO5du_Qt7S0aDDAvxR2znYeawNAPEk-g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Query slow for new participants  ("support@mekong.be" <support@mekong.be>)
Ответы Re: Query slow for new participants  ("support@mekong.be" <support@mekong.be>)
Список pgsql-performance

Indexes:
    "pk_pricedb" PRIMARY KEY, btree (companyid, articleid)
    "EnabledIndex" btree (enabled)
    "ix_companyarticledb_article" btree (articleid)
    "ix_companyarticledb_company" btree (companyid)

I'd say drop ix_companyarticledb_company since pk_pricedb can be used instead even if other queries are only on companyid field, and it will be faster for this case certainly since it targets the row you want directly from the index without the "Rows Removed by Filter: 2674361"

I doubt the default_statistics_target = 100 default is doing you any favors. You may want to try increasing that to 500 or 1000 if you can afford a small increase in planning cost and more storage for the bigger sampling of stats.

В списке pgsql-performance по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Aggregate and many LEFT JOIN
Следующее
От: "support@mekong.be"
Дата:
Сообщение: Re: Query slow for new participants