Re: why does seq scan instead of index scan

From: 中川 誠貴 <nakagawa(at)ivp(dot)co(dot)jp>
To: "Dmitriy Igrishin" <dmitigr(at)gmail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: why does seq scan instead of index scan
Date: 2011-01-17 01:25:22
Message-ID: 895509E8DA8F4649BBA565541CE333E9@IVPNAKAGAWAPC
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thank you very much.

I will try hstore columns.

Thanks.

From: Dmitriy Igrishin
Sent: Sunday, January 16, 2011 1:36 AM
To: 中川 誠貴
Cc: Tom Lane ; pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] why does seq scan instead of index scan

Hey,

To avoid creation of custom GiST-index you can use hstore,
which supports GiST and GIN indexes.
I propose you to add hstore column to the table and write trigger
function which will generate hstore from array on insert or update.
Or you can use hstore column instead of array.
Please, see http://www.postgresql.org/docs/9.0/static/hstore.html

2011/1/15 中川 誠貴 <nakagawa(at)ivp(dot)co(dot)jp>

Thank you for your response.

Are there any technique to index that query for like search on Text[] Columns?

Thanks.

Nakagawa Maskai

--------------------------------------------------
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Saturday, January 15, 2011 2:56 AM
To: "中川 誠貴" <nakagawa(at)ivp(dot)co(dot)jp>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] why does seq scan instead of index scan

=?iso-2022-jp?B?GyRCQ2ZAbiEhQD81LhsoQg==?= <nakagawa(at)ivp(dot)co(dot)jp> writes:

I'm trying to use like 'xx%' search on Text[] column.
I thought it uses index scan. But actually it uses seq scan.

Why?

Those ANY expressions are not indexable.

regards, tom lane

--
Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

--
Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

--
// Dmitriy.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message victor katemana 2011-01-17 08:42:34 failing to connect to postgresql with php
Previous Message Dmitriy Igrishin 2011-01-15 16:36:49 Re: why does seq scan instead of index scan