ARC2_StoreDeleteQueryHandler::runQuery PHP Method

runQuery() public method

*
public runQuery ( $infos )
    function runQuery($infos)
    {
        $this->infos = $infos;
        $con = $this->store->getDBCon();
        $t1 = ARC2::mtime();
        /* delete */
        $this->refs_deleted = false;
        /* graph(s) only */
        if (!$this->v('construct_triples', array(), $this->infos['query'])) {
            $tc = $this->deleteTargetGraphs();
        } elseif (!$this->v('pattern', array(), $this->infos['query'])) {
            $tc = $this->deleteTriples();
        } else {
            $tc = $this->deleteConstructedGraph();
        }
        $t2 = ARC2::mtime();
        /* clean up */
        if ($tc && ($this->refs_deleted || rand(1, 100) == 1)) {
            $this->cleanTableReferences();
        }
        if ($tc && rand(1, 100) == 1) {
            $this->store->optimizeTables();
        }
        if ($tc && rand(1, 500) == 1) {
            $this->cleanValueTables();
        }
        $t3 = ARC2::mtime();
        $index_dur = round($t3 - $t2, 4);
        $dur = round($t3 - $t1, 4);
        return array('t_count' => $tc, 'delete_time' => $dur, 'index_update_time' => $index_dur);
    }

Usage Example

示例#1
0
 function delete($doc, $g)
 {
     if (!$doc) {
         $infos = array('query' => array('target_graphs' => array($g)));
         ARC2::inc('StoreDeleteQueryHandler');
         $h = new ARC2_StoreDeleteQueryHandler($this->a, $this);
         $r = $h->runQuery($infos);
         $this->processTriggers('delete', $infos);
         return $r;
     }
 }