X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 224D3D1B8AD for ; Fri, 29 Aug 2003 15:12:45 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29385-08 for ; Fri, 29 Aug 2003 12:12:13 -0300 (ADT) Received: from mail.cict.nl (vnd-7521.mxs.adsl.euronet.nl [62.234.149.33]) by svr1.postgresql.org (Postfix) with ESMTP id 989EDD1B8A4 for ; Fri, 29 Aug 2003 12:12:12 -0300 (ADT) Received: from APR ([192.168.150.182]) by mail.cict.nl (Merak 6.0.5) with SMTP id DUC73886; Fri, 29 Aug 2003 17:12:00 +0200 Message-ID: <027701c36e40$2851aef0$b696a8c0@APR> From: "Alexander Priem" To: "Tom Lane" Cc: 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> <15992.1062165614@sss.pgh.pa.us> Subject: Re: Indexing question Date: Fri, 29 Aug 2003 17:13:52 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/498 X-Sequence-Number: 3314 Well, the intention is to hold every record that ever existed in the table. Therefore, records do not get deleted, but they get a date in the deleteddate field. This way, we can track what changes were made to the table(s). So if a record gets 'deleted', the field 'deleted' is set to today's date. If a record gets 'updated', a new record is made containing the new data, and the old record is marked as 'deleted'. So the percentage of 'deleted' records will grow with time, if you understand what I mean. ----- Original Message ----- From: "Tom Lane" To: "Alexander Priem" Cc: "Tomasz Myrta" ; Sent: Friday, August 29, 2003 4:00 PM Subject: Re: [PERFORM] Indexing question > "Alexander Priem" 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