From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Shaun Clements <ShaunC(at)relyant(dot)co(dot)za> |
Cc: | PostgreSQL General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: : Postgres IX |
Date: | 2005-04-01 09:45:23 |
Message-ID: | 424D1833.4000406@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Shaun Clements wrote:
> Or better yet.
> Can anyone explain the use of indexing, effecting the performance of select
> query, using INDEXED columns, and non indexed columns.
>
> I.E.
>
> Select from table where column1 = 'xxxx' and column2 = 'xxxxx'
>
> WHERE COLUMN1 is indexed, and COLUMN2 isnt.
Well, if PG chooses to use an index on column1 alone, it will use the
index to find column1='xxxx' and then check all those rows to find
column2='xxxx'.
Of course, it might decide to just scan the whole table if it thinks
going to the index and then the table is more expensive.
EXPLAIN ANALYSE SELECT ... will show the full details of what it is doing.
--
Richard Huxton
Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | GIROIRE Nicolas (COFRAMI) | 2005-04-01 09:56:23 | Re: Help with order by into a RECORD |
Previous Message | Shaun Clements | 2005-04-01 09:42:35 | FW: Help with order by into a RECORD |