Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id F0A26475B19 for ; Sat, 18 May 2002 11:15:07 -0400 (EDT) Received: from picard.skynet.be (picard.skynet.be [195.238.3.88]) by postgresql.org (Postfix) with ESMTP id 5F3B6475AF3 for ; Sat, 18 May 2002 11:15:06 -0400 (EDT) Received: from trotinette (adsl-40486.turboline.skynet.be [217.136.30.38]) by picard.skynet.be (8.11.6/8.11.6/Skynet-OUT-2.19) with SMTP id g4IFEwT10529 for ; Sat, 18 May 2002 17:14:58 +0200 (MET DST) (envelope-from ) Message-ID: <001601c1fe7e$bf271af0$0701a8c0@trotinette> From: =?iso-8859-1?Q?Ga=EBtan_de_Menten?= To: Subject: Simple PHP/pgsql optimization question... Date: Sat, 18 May 2002 17:14:46 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200205/60 X-Sequence-Number: 1192 Hi there all, First, I'm far from being a professional programmer in pgsql and PHP and I'm new to this list, so please pardon if this question seems stupid to you. In my 'projects' tables, among many other fields, I need a 'license' field. I need to optimize the display of the list of all projects (+-200 projects to display). Which solution do you think would be the fastest, and how much faster? 1) Have a 'license' table (with and id and a name field) listing all the possible licenses and have a foreign key in my 'projects' table pointing to that 'license' table. the query would look like this: select ..., license.name as license from projects, licenses where projects.license=license.id and ... 2) Have the license field in the 'projects' table be a varchar field and store the name of the license directly. 3) Have the license field be an int and have an array in PHP listing all the licenses. 4) another solution? I personnaly prefer the first solution since it's the cleanest to my eyes but I'm ready to trade that for speed, if another solution is much faster. Thanks a lot, Gaëtan.