Commit f5c18269 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#644482 by hass (backport of #452936): use TRUNCATE to do full cache clearing,...

#644482 by hass (backport of #452936): use TRUNCATE to do full cache clearing, which results in a dramatic speed increase
parent ce14b924
......@@ -169,7 +169,7 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {
else {
if ($wildcard) {
if ($cid == '*') {
db_query("DELETE FROM {". $table ."}");
db_query("TRUNCATE TABLE {". $table ."}");
}
else {
db_query("DELETE FROM {". $table ."} WHERE cid LIKE '%s%%'", $cid);
......
......@@ -557,7 +557,7 @@ function _update_cache_set($cid, $data, $expire) {
}
}
/**
/**
* Retrieve data from the private update status cache table.
*
* @param $cid
......@@ -585,7 +585,7 @@ function _update_cache_get($cid) {
*/
function _update_cache_clear($cid = NULL) {
if (empty($cid)) {
db_query("DELETE FROM {cache_update}");
db_query("TRUNCATE TABLE {cache_update}");
}
else {
db_query("DELETE FROM {cache_update} WHERE cid = '%s'", $cid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment