Skip to content

Instantly share code, notes, and snippets.

@rueian
Created January 1, 2020 18:10
Show Gist options
  • Save rueian/69b9042e9994c96c47617f47d2d19235 to your computer and use it in GitHub Desktop.
Save rueian/69b9042e9994c96c47617f47d2d19235 to your computer and use it in GitHub Desktop.
postgres=# explain analyze select * from counters where id >= 'ms:149895:' and id <= 'ms:149895;' and id like 'ms:149895:%';
 QUERY PLAN
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 Index Scan using counters_pkey on counters (cost=0.56..8.58 rows=1 width=36) (actual time=0.023..0.039 rows=10 loops=1)
 Index Cond: ((id >= 'ms:149895:'::text) AND (id <= 'ms:149895;'::text) AND (id >= 'ms:149895:'::text) AND (id < 'ms:149895;'::text))
 Filter: (id ~~ 'ms:149895:%'::text)
 Planning Time: 0.156 ms
 Execution Time: 0.036 ms
(5 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment