Re: Fwd: Help required on query performance

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: dclements89(at)gmail(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Fwd: Help required on query performance
Date: 2010-02-01 05:16:15
Message-ID: dcc563d11001312116u489f7c3dvcf576b3881e7760a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sun, Jan 31, 2010 at 9:25 PM, Dave Clements <dclements89(at)gmail(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Neil Stlyz 2010-02-01 07:36:55 combine SQL SELECT statements into one
Previous Message Tom Lane 2010-02-01 04:41:56 Re: Howto have a unique restraint on UPPER (textfield)