Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E1EE44758C9 for ; Sun, 26 Jan 2003 16:24:03 -0500 (EST) Received: from smtp.enternet.hu (smtp.enternet.hu [62.112.192.21]) by postgresql.org (Postfix) with ESMTP id 0310D475843 for ; Sun, 26 Jan 2003 16:24:03 -0500 (EST) Received: from localhost.localdomain (maci@3e70db28.adsl.enternet.hu [62.112.219.40]) by smtp.enternet.hu (8.12.6/8.12.6) with ESMTP id h0QLNwrb036283 for ; Sun, 26 Jan 2003 22:23:59 +0100 (CET) (envelope-from eire@enternet.hu) Subject: bigserial vs serial - which one I'd have to use? From: Medve Gabor To: pgsql-performance@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 26 Jan 2003 22:24:41 +0100 Message-Id: <1043616281.829.38.camel@maci> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/338 X-Sequence-Number: 985 Hi all, Have you got any data (ie in percentage) of around how much more CPU work needed with the bigserial type in the queries? I have a log database with 100million records (the biggest table contains 65million records) and I use bigserial data type as primary key now. The primary key looks this way: YYYYMMDD1xxxxxxx where the first 8 numbers are the date, and the x's are the record sequence number on that day. This way the records are in ascendant order. Almost all of the queries contains date constraints (PK like 'YYYYMMDD%'). I'd like to know if I do it in a stupid way or not. I'm not a DBA expert so every idea are welcome. If you need more information about the hardware/software environment, the DB structure then I'll post them. Thanks in advance for your help. Gabor