pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Priem <ap@cict.nl>
Cc: Tomasz Myrta <jasiek@klaster.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Indexing question
Date: Fri, 29 Aug 2003 10:00:14 -0400
Message-ID: <15992.1062165614@sss.pgh.pa.us> (raw)
In-Reply-To: <01bf01c36e0d$18769280$b696a8c0@APR>
References: <012f01c36dfa$0f4a8760$b696a8c0@APR>
	<3F4EFAB6.7030104@klaster.net>
	<015f01c36e02$134fe960$b696a8c0@APR>
	<3F4F07CE.6090803@klaster.net>
	<018c01c36e09$4893e980$b696a8c0@APR>
	<3F4F1575.8090600@klaster.net>
	<01bf01c36e0d$18769280$b696a8c0@APR>

"Alexander Priem" <ap@cict.nl> writes:
> Does anyone know whether it is bad practise to have two indexes on the
> primary key of a table? (one 'primary key' index and one partial index)

It's a little unusual, but if you get enough performance boost from it
to justify the maintenance cost of the extra index, then I can't see
anything wrong with it.

The "if" is worth checking though.  I missed the start of this thread,
but what percentage of your rows do you expect to have null deleteddate?
Unless it's a pretty small percentage, I'm unconvinced that the extra
indexes will be worth their cost.

			regards, tom lane



view thread (15+ messages)  latest in thread

Message-ID: <15992.1062165614@sss.pgh.pa.us>
Permalink:  ../15992.1062165614@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15992.1062165614@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ap@cict.nl, jasiek@klaster.net
  Subject: Re: Indexing question
  In-Reply-To: <15992.1062165614@sss.pgh.pa.us>

* 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