Re: Query tune, index is not using

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: AI Rumman <rummandba(at)gmail(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query tune, index is not using
Date: 2010-10-05 17:53:20
Message-ID: 60BA90C7-2BF8-4F25-BCC9-229DFE41030F@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5 Oct 2010, at 10:21, AI Rumman wrote:

> explain analyze
> select cf_1507
> from cf_1507
> inner join role2picklist on role2picklist.picklistvalueid=cf_1507.picklist_valueid
> where roleid!='H1' order by sortid

A few indexes on role2picklist.sortid and cf_1507.picklist_valueid would probably help.

> \d role2picklist
> Table "public.role2picklist"
> Column | Type | Modifiers
> -----------------+------------------------+-----------
> roleid | character varying(255) | not null
> picklistvalueid | integer | not null
> picklistid | integer | not null
> sortid | integer |
> Indexes:
> "role2picklist_pkey" PRIMARY KEY, btree (roleid, picklistvalueid, picklistid)
> "fk_2_role2picklist" btree (picklistid)
> "role2picklist_picklistvalueid_idx" btree (picklistvalueid)
> "role2picklist_roleid_picklistid_idx" btree (roleid, picklistid, picklistvalueid)
>
> \d cf_1507
> Table "public.cf_1507"
> Column | Type | Modifiers
> ------------------+------------------------+----------------------------------------------------------
> cf_1507id | integer | not null default nextval('cf_1507_seq'::regclass)
> cf_1507 | character varying(200) | not null
> presence | integer | not null default 1
> picklist_valueid | integer | not null default 0
> Indexes:
> "cf_1507_pkey" PRIMARY KEY, btree (cf_1507id)

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,4cab661b678301651414001!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rajesh Kumar Mallah 2010-10-05 18:00:56 Re: Non-standard escape sequences from Crystal Reports
Previous Message Rob Richardson 2010-10-05 17:51:05 Non-standard escape sequences from Crystal Reports