Re: Bad query plan when you add many OR conditions

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Marco Colli <collimarco91(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Bad query plan when you add many OR conditions
Date: 2020-01-13 22:14:11
Message-ID: 20200113221411.sm5dm6fol3uwbuyp@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Jan 10, 2020 at 02:30:27PM +0100, Marco Colli wrote:
>@Justin Pryzby I have tried this as you suggested:
>
>CREATE STATISTICS statistics_on_subscriptions_project_id_and_tags ON
>project_id, tags FROM subscriptions;
>VACUUM ANALYZE subscriptions;
>
>Unfortunately nothing changes and Postgresql continues to use the wrong
>plan (maybe stats don't work well on array fields like tags??).
>

We support this type of clause for extended statistics (yet).

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alvaro Herrera 2020-01-13 22:15:11 Re: Seeking reason behind performance gain in 12 with HashAggregate
Previous Message Shira Bezalel 2020-01-13 21:45:55 Re: Seeking reason behind performance gain in 12 with HashAggregate