Re: planning issue

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Jonathan Vanasco <postgres(at)2xlp(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: planning issue
Date: 2007-03-16 19:17:37
Message-ID: 45FAED51.8060705@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>
> QUERY PLAN
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Seq Scan on table_a (cost=0.00..22779.68 rows=1 width=346)
> Filter: ((id <> 10001) AND (((field_1)::text ~~* '123'::text) OR
> ((field_2)::text ~~* 'abc'::text)))
>
>
> however, i have the following indexes:
>
> "table_a__pkey" PRIMARY KEY, btree (id)
> "table_a__idx__field_1" btree (field_1)
> "table_a__idx__field_2" btree (field_2)
>
> can anyone offer advice to help me use the indexes on this ?

create a function lower index and instead of calling ilike call ~
lower('123')

Joshua D. Drake

>
>
> // Jonathan Vanasco
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kacper Chrapa 2007-03-16 19:19:41 Own messages for constraints?
Previous Message Bruce McAlister 2007-03-16 19:06:57 Re: PostgreSQL 8.2.3 VACUUM Timings/Performance