Re: PHP SQL - Mailing list pgsql-general

From Shaun Clements
Subject Re: PHP SQL
Date
Msg-id 100F78F2B203444BB161BBA7077FF6131CD960@srldbexc003.relyant.co.za
Whole thread Raw
In response to PHP SQL  (Shaun Clements <ShaunC@relyant.co.za>)
Responses Re: PHP SQL  (Richard Huxton <dev@archonet.com>)
List pgsql-general

Excellent idea. Yes, I would prefer to write in plpgsql.
My next concern then, is, does Postgres, perform some kind of Load Balancing.
I dont want the stored procedure once run, to DOS other users, who are running reports.. or perform queries using some application.

The reason for asking, is I plan on taking, 350 000 rows, and transforming them, into hopefully about 50% smaller number (in a new schema)

It is critical, that I dont DOS the database server, because it is being used in a PRODUCTION enviroment

Kind Regards,
Shaun Clements

-----Original Message-----
From: Michael Fuhr [mailto:mike@fuhr.org]
Sent: 22 March 2005 02:01 PM
To: Shaun Clements
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PHP SQL

On Tue, Mar 22, 2005 at 01:25:30PM +0200, Shaun Clements wrote:

> Which is more efficient, in reading in a row of data, and assigning
> individual column values to variables, and then inserting a new row into the
> new table.
>
> pg_fetch_row
> pg_fetch_assoc
> pg_fetch_object
> pg_fetch_result
> pg_fetch_array
>
> Are there performance differences, which are noticeable?

The best way to determine this would be to benchmark each method
in your own environment and observe whether there are significant
differences.

Have you considered using a server-side function to avoid passing
the data back and forth between the client and the server?  Are you
familiar with constructs like CREATE TABLE AS and INSERT...SELECT?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Shachar Shemesh
Date:
Subject: Version 1.0.0.19 of OLE DB released
Next
From: Szmutku Zoltán
Date:
Subject: Constraint problem