Sunday, March 28, 2010

SQL_BUFFER_RESULT may return stale result

Careful with SQL_BUFFER_RESULT in your mysql SELECT statement
While this may speed up the selects (sometimes by a lot), it will also get you the cached result, in some cases the result may be stale, not reflecting the changes that took place after the previous result was cached.

This was probably not intended to be like that, may be just a weird behavior when using PDO and somehow temporary table that was created for that BUFFER_RESULT was not removed. I don't know why, I am not a mysql developer, I just know what I see - when using SELECT HIGH_PRIORITY SQL_BUFFER_RESULT .... with php PDO class, the result may be stale.

No comments:

Post a Comment