X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 7A1B330F01C for ; Tue, 17 Jun 2003 08:39:29 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 75100-07 for ; Tue, 17 Jun 2003 05:39:19 -0300 (ADT) Received: from server.kregert.se (h147n1fls35o811.telia.com [217.211.118.147]) by svr1.postgresql.org (Postfix) with ESMTP id D20B830EED5 for ; Tue, 17 Jun 2003 05:39:17 -0300 (ADT) Received: from knatte (knatte.kregert.se [10.10.0.9]) by server.kregert.se (8.12.2/8.12.2) with SMTP id h5H8aOam024880 for ; Tue, 17 Jun 2003 10:36:25 +0200 Message-ID: <021301c334ab$633b79c0$09000a0a@kregert.se> From: "Mattias Kregert" To: Subject: Request for advice: Table design Date: Tue, 17 Jun 2003 10:35:19 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200306/983 X-Sequence-Number: 43913 Good morning, list! I am in the middle of a project and i am just about to decide how to lay ou= t the table(s) for work orders. I had been planning to use one table, but n= ow i'm not so sure that it would be optimal. The order history will grow with something like 150K-200K rows/year and wil= l have to be saved for ten years. The total number of active (new+validated+planned+ready_for_invoicing) orde= rs would be something like 5K rows. I am thinking about two solutions: 1. One table, "orders" with a column named "status". New orders, validated = orders, planned orders, ready for invoicing, and old orders, all in one big= table. The status column would be updated a number of times for each order. 2. A number of tables, "new_orders", "validated_orders", "order_history" et= c... No status column. Order rows would be moved from one table to another.= Perhaps i should have only two tables: "orders" and "order_history"? More tables would mean more indexes (but smaller in size), harder to use/ma= intain a lot of tables and indexes and triggers and stuff... One table woul= d mean that a lot of inactive orders would slow down access to active rows = in the table... Any suggestions? Real world examples? /M