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 7C42F30F088 for ; Tue, 17 Jun 2003 16:24:53 +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 47507-05 for ; Tue, 17 Jun 2003 13:24:42 -0300 (ADT) Received: from mail.deltav.hu (oldmail.deltav.hu [213.163.0.192]) by svr1.postgresql.org (Postfix) with ESMTP id AE79B30F18E for ; Tue, 17 Jun 2003 13:24:41 -0300 (ADT) Received: from fejleszt4 ([213.163.10.103]) by mail.deltav.hu (Netscape Messaging Server 3.6) with SMTP id AAA14BF for ; Tue, 17 Jun 2003 18:24:39 +0200 Message-ID: <030601c334ed$16070c40$0403a8c0@fejleszt4> From: =?iso-8859-1?Q?SZUCS_G=E1bor?= To: References: <021301c334ab$633b79c0$09000a0a@kregert.se> Subject: Re: Request for advice: Table design Date: Tue, 17 Jun 2003 18:22:17 +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.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Archive-Number: 200306/1039 X-Sequence-Number: 43969 Mattias, Here goes how we do it: order_status (id, name): valid order statuses order (partners, dates, status, etc): main data of order refs to order_status order_statuschange (order, timestamp, oldstatus, newstatus, user): history of status changes on each order refs to order (cascade), order_status order_mod (order, mod, user, closed, etc): separate modifications for an order (only the newest is able to receive items, see below) refs to order (cascade) order_item (order, itemno, archive, archive_from_mod): items in each order. refs to order (cascade), order_mod order_notify (order, timestamp, user, operation): log and notify table does NOT ref to order so delete from order leaves this table alone. The same structure goes for shipments and invoices. A note: order_mod is a historical thing we'd like to get rid of, but our hands are always full to do that, so we let it stay. G. ------------------------------- cut here ------------------------------- ----- Original Message ----- From: "Mattias Kregert" Sent: Tuesday, June 17, 2003 10:35 AM More tables would mean more indexes (but smaller in size), harder to use/maintain a lot of tables and indexes and triggers and stuff... One table would mean that a lot of inactive orders would slow down access to active rows in the table... Any suggestions? Real world examples?