From: | "dennis(at)zserve(dot)com" <dennis(at)zserve(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Multiple Indexes |
Date: | 2001-07-02 15:38:14 |
Message-ID: | 200107021538.f62FcEW05065@mail.ldssingles.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi Group,
Lets say table a has fields: id serial, name varchar(20) not null, and
somedata int not null.
I'll be doing lots of queries on this table so I'll want to define and
index. ( or two? ).
Some queries will only look up the name. Others will look up the name
depending on somedata.
If I were to define and index like this:
1) create index i on sometable ( name, somedata );
and another one like this:
2) create index i2 on sometable ( name );
Would that be better than defining only the first index?
What I am asking is:
Should I have an index devoted to just the name field, or
would that first index work just fine? I know that more indexes
means slower time on inserts.
Any suggestions appreciated.
-Dennis
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Berger | 2001-07-02 15:50:26 | query optimizer questions |
Previous Message | Peter Eisentraut | 2001-07-02 14:52:33 | Re: 7.1 docs -- "create table"? |