Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. $statement = $connection->prepare('SELECT count(item_id) AS count FROM MyView WHERE active = 1 AND context_id = 5 AND snapshot_id = 24');
  2. $time_start = microtime_float();
  3. $statement->execute();
  4. $time_end = microtime_float();
  5. $time1 = round($time_end - $time_start, 4);
  6. $result = $statement->fetch()['count'];
  7.  
  8. $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');
  9. $statement->bindValue('filter_active', 1, 2);
  10. $statement->bindValue('filter_context_id', 5, 2);
  11. $statement->bindValue('filter_snapshot_id', 24, 2);
  12. $time_start = microtime_float();
  13. $statement->execute();
  14. $time_end = microtime_float();
  15. $time2 = round($time_end - $time_start, 4);
  16. $result = $statement->fetch()['count'];
  17. enter code here
  18.  
  19. time1 = 0.79 sec
  20. time2 = 31.50 sec
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement