Re: Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

From: otar shavadze <oshavadze(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org, jeff(dot)janes(at)gmail(dot)com
Subject: Re: Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists
Date: 2016-11-10 12:41:22
Message-ID: CAG-jOyA99+cr1EOkoNj0Q6wfNGMkrKpHSfLs4SHiV=GC5AKxQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

@Jeff

> most_common_elems. Is it empty, or is it not empty? If not empty, does
> it contain the specific values you used in your queries?

No, most_common_elems is not empty. it contain the specific values I used
in queries.

@Tom

>
> Hmmm ... actually, I wonder if maybe '@>' here is the contrib/intarray
> operator not the core operator? The intarray operator didn't get plugged
> into any real estimation logic until 9.6.

So, you mean that better would be go to version 9.6 ?

On Wed, Nov 9, 2016 at 8:35 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I wrote:
> > Seems like your problem here is that the planner has no idea about the
> > selectivity of this condition --- if it did, I think it would have
> > made the right choice, because it would have made a much higher estimate
> > for the cost of the indexscan.
>
> > AFAICT, Postgres 9.5 does make a reasonably correct guess when given
> > up-to-date stats. I speculate that you need to ANALYZE this table.
>
> Hmmm ... actually, I wonder if maybe '@>' here is the contrib/intarray
> operator not the core operator? The intarray operator didn't get plugged
> into any real estimation logic until 9.6.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message JingYuan Chen 2016-11-10 12:49:48 Re: Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)
Previous Message Raymond O'Donnell 2016-11-10 10:44:16 Re: Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)