Simple PHP/pgsql optimization question...

From: Gaëtan de Menten <ged(at)bugfactory(dot)org>
To: <pgsql-php(at)postgresql(dot)org>
Subject: Simple PHP/pgsql optimization question...
Date: 2002-05-18 15:14:46
Message-ID: 001601c1fe7e$bf271af0$0701a8c0@trotinette
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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.

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Chadwick Rolfs 2002-05-18 15:47:38 Re: Simple PHP/pgsql optimization question...
Previous Message Andrew McMillan 2002-05-18 12:09:51 Re: using CURSOR with PHP