The number of variables you are using probably won't make much of an impact
on performance. You may want to test doing it both ways, you can use the
gettimeofday function to do function profiling, it will return the time with
microsecond accuracy. I'm guessing one call to the database at the start of
script execution would be much faster assuming all the variables are in the
same row. A lot of the time spent executing the query is spent on doing a
disk seek, which will be greatly reduced if everything is placed in one
call.
Jon Snell
-----Original Message-----
From: Andrew Elliston [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 1:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] sessions - max number of variables before things get bad?
I'm exploring sessions in PHP4 as I build a new site, and I have decided to
rely on them more heavily than in the past.
Basically, I'd like to set things up so that when someone logs into the
site, all of their accounts variables are queried from a database and loaded
into session variables (we're talking about 50 variables, most just 1-3
words). Does this sound reasonable for a relatively high traffic site? If I
don't do this, then many of those variables will probably be queried from a
database more than once during a visit, which seems unnecessary when I can
use session variables.
Are there any guidelines on the performance penalty for using large numbers
of session variables? Or is the affect so minute that I really shouldn't
worry about it? (especially compared to querying a database)
Thanks,
Andrew
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]