Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $statement = $connection->prepare('SELECT count(item_id) AS count FROM MyView WHERE active = 1 AND context_id = 5 AND snapshot_id = 24');
- $time_start = microtime_float();
- $statement->execute();
- $time_end = microtime_float();
- $time1 = round($time_end - $time_start, 4);
- $result = $statement->fetch()['count'];
- $statement = $connection->prepare('SELECT count(item_id) AS count FROM MyView WHERE active = :filter_active AND context_id = :filter_context_id AND snapshot_id = :filter_snapshot_id');
- $statement->bindValue('filter_active', 1, 2);
- $statement->bindValue('filter_context_id', 5, 2);
- $statement->bindValue('filter_snapshot_id', 24, 2);
- $time_start = microtime_float();
- $statement->execute();
- $time_end = microtime_float();
- $time2 = round($time_end - $time_start, 4);
- $result = $statement->fetch()['count'];
- enter code here
- time1 = 0.79 sec
- time2 = 31.50 sec
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement