From: | Alexaki Sofia <alexaki(at)ics(dot)forth(dot)gr> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | A question about indexes... |
Date: | 2000-08-03 17:51:44 |
Message-ID: | Pine.GSO.4.10.10008032023500.25089-100000@sappho.ics.forth.gr |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hello,
I have the following tables in my db
Painter (id integer, uri varchar(256)) and
paints (id1 integer, id2 integer)
I want to optimize the question
select id from Painter where uri = 'xxxxx';
What kind of index (Btree or Hash) is more efficient to create on field
uri since it's a string?
I also want to optimize the join between the ables Painter and paints
on the fields id and id1 respectively?
I can either define the field id as a Primary Key or create an Btree index
on it. What is more effient??
>From my test I see that creating Btree index is a bit faster!!.
Would the performance (of the join) be improved if I created indexes
both on field id and id1 or it's sufficient to create one of the two
indexes ?
As far as I can see the performance is improved if I have a Primary Key on
Painter.id and a BTree index on paints.id1. However when I create a
Btree index on Painter.id and a BTree index on paints.id1 performance
gets worst.
thank you in advance for your help
Sofia Alexaki
alexaki(at)ics(dot)forth(dot)gr
From | Date | Subject | |
---|---|---|---|
Next Message | John McKown | 2000-08-03 19:23:34 | Re: Extracting data by months |
Previous Message | Dana.Reed | 2000-08-03 17:24:13 | SQL (table transposition) |