From: dennis@zserve.com <dennis@zserve.com>
To: pgsql-general@postgresql.org
Subject: Multiple Indexes
Date: 02 Jul 2001 09:38:14 -0600
Message-ID: <200107021538.f62FcEW05065@mail.ldssingles.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: dennis@zserve.com
Subject: Re: Multiple Indexes
In-Reply-To: <200107021538.f62FcEW05065@mail.ldssingles.com>
References: <200107021538.f62FcEW05065@mail.ldssingles.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox