Skip site navigation (1) Skip section navigation (2)

faster output from php and postgres

From: Mukta Telang <mukta(at)darya(dot)nio(dot)org>
To: pgsql-php(at)postgresql(dot)org
Subject: faster output from php and postgres
Date: 2003-05-23 15:39:23
Message-ID: 3ECE40AB.73544B27@darya.nio.org (view raw or flat)
Thread:
Lists: pgsql-phppgsql-sql
Hi,
I am dealing with a database with many-to-many relation and have a php
script that joins these tables and displays the output.
But the problem is that after entering some 50 records the output is
very slow!
I can count till 50 before the script produces the output!
The complete description of the problem is written below..
Thanks in advance,
Mukta




description in detail:


database part:

Three tables: paper,author and author_paper

"A paper has many authors and an author has many papers."
In this way there is many to many relation.

The attributes of paper are: paper_id (primary key),title,journal,year
etc

The attributes of author are: author_id(primary key) and name

The attributes of author_paper are: author_id ,paper_id and level
( author with level=1 is the main author of the paper )



php part:

For an author:
1. get author_id from author table
2. select all paper_ids from author_paper table
3. For each of the above selected paper_ids:
        a. print all the attributes of paper
        b. select all authors of the paper and print their names in the
order
of their "level"

Responses

pgsql-php by date

Next:From: scott.marloweDate: 2003-05-23 15:45:06
Subject: Re: Number of connections
Previous:From: thoyerjDate: 2003-05-23 15:25:59
Subject: pg_connect

pgsql-sql by date

Next:From: Achilleus MantziosDate: 2003-05-23 15:43:09
Subject: Re: language "plpgsql" does not exist
Previous:From: Stephan SzaboDate: 2003-05-23 15:17:32
Subject: Re: Can arrays reference primary keys in CREATE TABLE?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group