2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
// When serving cached pages, the overhead of using db_select() was found
// When serving cached pages, the overhead of using ::select() was found
// to add around 30% overhead to the request. Since $this->bin is a
// variable, this means the call to db_query() here uses a concatenated
// variable, this means the call to ::query() here uses a concatenated
// string. This is highly discouraged under any other circumstances, and
// is used here only due to the performance overhead we would incur
// otherwise. When serving an uncached page, the overhead of using
// db_select() is a much smaller proportion of the request.
$result=db_query('SELECT cid, data, created, expire, serialized, tags, checksum FROM {'.db_escape_table($this->bin).'} WHERE cid IN (:cids)',array(':cids'=>$cids));
// ::select() is a much smaller proportion of the request.
$result=Database::getConnection()->query('SELECT cid, data, created, expire, serialized, tags, checksum FROM {'.Database::getConnection()->escapeTable($this->bin).'} WHERE cid IN (:cids)',array(':cids'=>$cids));
$cache=array();
foreach($resultas$item){
$item=$this->prepareItem($item);
...
...
@@ -135,7 +136,7 @@ function set($cid, $data, $expire = CacheBackendInterface::CACHE_PERMANENT, arra
}
try{
db_merge($this->bin)
Database::getConnection()->merge($this->bin)
->key(array('cid'=>$cid))
->fields($fields)
->execute();
...
...
@@ -149,7 +150,7 @@ function set($cid, $data, $expire = CacheBackendInterface::CACHE_PERMANENT, arra
if($db_tags=Database::getConnection()->query('SELECT tag, invalidations FROM {cache_tags} WHERE tag IN (:tags)',array(':tags'=>$query_tags))->fetchAllKeyed()){