Received: from mail.ldssingles.com (mail.ldssingles.org [63.226.117.101]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f62FcLa39350 for ; Mon, 2 Jul 2001 11:38:22 -0400 (EDT) (envelope-from dennis@zserve.com) Received: from vader.zserve.com (dennis.ldssingles.com [192.168.1.39]) by mail.ldssingles.com (8.11.2/8.11.2) with ESMTP id f62FcEW05065 for ; Mon, 2 Jul 2001 09:38:14 -0600 Message-Id: <200107021538.f62FcEW05065@mail.ldssingles.com> Subject: Multiple Indexes From: "dennis@zserve.com" To: pgsql-general@postgresql.org Content-Type: text/plain X-Mailer: Evolution (0.9 - Preview Release) Date: 02 Jul 2001 09:38:14 -0600 Mime-Version: 1.0 X-Archive-Number: 200107/13 X-Sequence-Number: 11915 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