Date: 02/27/01
- Next message: Chris Johnson: "RE: [phplib] Database query"
- Previous message: Philip Strnad: "Re: [phplib] how to check if logined in?"
- In reply to: Bryan Brunton: "[phplib] pg_fetch_array, memory usage, and performance"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I don't have Postgres installed, so I can't look at its client API and
tell you what its library calls do exactly, but the PHP code which calls
it looks roughly the same as the code which calls MySQL. MySQL only
fetches the data once, so the data only uses bandwidth once. However,
it is true that if the row has contains both numeric and associative
values, it probably is using more memory unless PHP is very clever. I
didn't bother to read PHP's code for how it handles arrays to see what
they do.
PGSQL is very similar to MySQL, except it does not appear to have a
single API call to get the entire row, and so the PHP code loops through
the fields getting each one individually. Still, it only does this
once, so the data is only crossing the wire from the database once.
This is really a question for the PHP list, but I can understand your
reticence to ask it there. The level of conversation is much better
here on the PHPLIB list, and the volume and noise level on the PHP list
is just way too high. I wish they'd split it into a "beginners" list
and an "experts" list. :-)
..chris
> -----Original Message-----
> From: Bryan Brunton [mailto:bryanbrun <email protected>]
> Sent: Saturday, February 24, 2001 2:32 PM
> To: phplib <email protected>
> Subject: [phplib] pg_fetch_array, memory usage, and performance
>
>
>
> I've noticed that pg_fetch_array uses the default of
> PGSQL_BOTH. This returns associative and
> numerical array values; effectively it returns all of the
> values that you want TWICE.
>
> So anyone who uses just the PHPLIB associative dataset
> functionality as it is documented such as:
>
> $db->f("fieldname")
>
> is using TWICE the memory and TWICE the bandwidth as necessary.
>
> Is this correct?
>
> If people are actually using the numerical functionality
> $db->f(0)), perhaps a note could be put
> in the documentation that states if you are just using the
> associative access to the dataset you
> could decrease memory usage if you pass the correct parameter
> in pg_fetch_array.
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Chris Johnson: "RE: [phplib] Database query"
- Previous message: Philip Strnad: "Re: [phplib] how to check if logined in?"
- In reply to: Bryan Brunton: "[phplib] pg_fetch_array, memory usage, and performance"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

