|
Posted by Dominic on 10/02/06 05:46
I am setting up real-time server stats using database INSERTs, one per page.
The majority of hits to my database will be to increment a value
representing page views. Since the query format is identical every time but
uses different values, it seems like a perfect fit for prepared statements.
However, each statement occurs only once per page. Does php and mysql have
a way to still make use of this new method of data insertion?
I have used prepared statements when performing multiple INSERTs in a loop,
because there is an obvious performance increase in that situation since the
same query is run multiple times on a single page. However, the INSERT
queries that will be executed for real-time stats will occur once per page
across multiple pages. Does that mean I lose my performance benefit?
I know that prepared statements don't use the query cache. However, is there
some sort of timeout or server persistence of recent prepared statements
which will give me a performance benefit by using them for this
once-per-page insert statement? I'm running PHP 5 and MySql 5, and I've
scoured the web for a couple of hours now and can't seem to find the answer
to that question.
Any help would be appreciated. Thanks.
Dominic
Navigation:
[Reply to this message]
|