Re: Understanding "seq scans" - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Understanding "seq scans"
Date
Msg-id 20151012221309.GQ4405@alvherre.pgsql
Whole thread Raw
In response to Understanding "seq scans"  (Lele Gaifax <lele@metapensiero.it>)
List pgsql-general
Lele Gaifax wrote:
> Hi all,
>
> I'm doing some experiments to find the better layout for reimplementing
> an existing db (MySQL cough!) with PostgreSQL 9.4+.
>
> I noticed a strange plan coming out from a simple query joining two tables,
> both containing 10Mrecs (and both ANALYZEd):

>              ->  Bitmap Index Scan on l10n_text_index  (cost=0.00..64549.19 rows=999662 width=0)
>                    Index Cond: ((lower(text) ~>=~ 'quattro'::text) AND (lower(text) ~<~ 'quattrp'::text))

So 10% of your rows in the master_l10n table start with "quattro"?
That's pretty odd, isn't it?  How did you manufacture these data?

I wonder if the l10n_text_index index should be on (lang, lower(text)).
How often are you going to look for translated text without specifying a
language?

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


pgsql-general by date:

Previous
From: Lele Gaifax
Date:
Subject: Re: Understanding "seq scans"
Next
From: Israel Brewster
Date:
Subject: Re: Pattern match against array elements?