Re: Understanding "seq scans"

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Lele Gaifax <lele(at)metapensiero(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Understanding "seq scans"
Date: 2015-10-12 22:13:09
Message-ID: 20151012221309.GQ4405@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Israel Brewster 2015-10-12 23:21:54 Re: Pattern match against array elements?
Previous Message Lele Gaifax 2015-10-12 21:46:22 Re: Understanding "seq scans"