Re: SESSIONS vs. MySQL
| From: | Per Jessen | Date: | Mon, 22 Sep 2008 07:00:47 +0000 |
| Subject: | Re: SESSIONS vs. MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280670@lists.php.net to get a copy of this message | ||
Philip Thompson wrote:
> Ok, so I've implemented this in several places where information
> basically does not change from page to page. Jumping to the point/
> question... when does it become more inefficient to store lots of
> information in SESSION variables than to run several more queries?
> Note, we are actually storing sessions in the database - so a read/
> write is required on each page load - it's not file sessions.
I don't think you're likely to see any measurable difference, not until
your sessions get VERY big (I'm guessing megabytes). There's is
overhead associated with both forms - the SESSION data must be
serialized/de-serialized, the mysql calls organises data to/from an
associative array etc., but what is hauled out of the database is
essentially the same, it's only the transmission method that differs.
/Per Jessen, Zürich