Re: Fwd: Help required on query performance - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Fwd: Help required on query performance
Date
Msg-id dcc563d11001312116u489f7c3dvcf576b3881e7760a@mail.gmail.com
Whole thread Raw
In response to Re: Fwd: Help required on query performance  (Dave Clements <dclements89@gmail.com>)
List pgsql-sql
On Sun, Jan 31, 2010 at 9:25 PM, Dave Clements <dclements89@gmail.com> wrote:
> After the analyze I am getting the time 3.20 ms but there is not
> HashJoin there. Still all of them are NestLoops. But that is fine.
>
> Now the only problem is the sequence scan on sq_sch_idx table.
> I have a query like this:
>
> explain analyze select count(*) from sq_sch_idx where value = '%download%';
>
> This query does a sequence scan on the table. Is there a way I can
> create an index for this?

If it's not left anchored ( value like 'download%') then not with
regular old methods.  If you need to do text searching you might need
to look into the full text search indexing in pgsql.


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Howto have a unique restraint on UPPER (textfield)
Next
From: Neil Stlyz
Date:
Subject: combine SQL SELECT statements into one