Re: query of partitioned object doesnt use index in qa

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-performance(at)postgresql(dot)org,Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Mike Broers <mbroers(at)gmail(dot)com>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>,postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query of partitioned object doesnt use index in qa
Date: 2017-09-15 21:03:58
Message-ID: 862584A2-724B-4F5A-976F-6164AE61BBE5@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On September 15, 2017 1:42:23 PM PDT, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>One thing you could consider doing about this is creating an index
>on (body ->> 'SID'::text), which would prompt ANALYZE to gather
>statistics
>about that expression. Even if the index weren't actually used in the
>plan, this might improve the estimates and the resulting planning
>choices
>enough to make it worth maintaining such an index.

I'm wondering if we should extend the new CREATE STATISTICS framework to be able to do that without requiring an index. I.e. allow expressions and add a new type of stats that just correspond to what normal columns have. Could even create that implicitly for expression indexes, but allow to drop it, if the overtrading isn't worth it.

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2017-09-15 22:05:31 Re: query of partitioned object doesnt use index in qa
Previous Message Mike Broers 2017-09-15 20:59:17 Re: query of partitioned object doesnt use index in qa