Skip to content

Instantly share code, notes, and snippets.

@mdcallag
Last active April 4, 2026 00:28
Show Gist options
  • Select an option

  • Save mdcallag/42306744249b368d2a54b9d44d9b1def to your computer and use it in GitHub Desktop.

Select an option

Save mdcallag/42306744249b368d2a54b9d44d9b1def to your computer and use it in GitHub Desktop.
- MySQL 8.4.7
explain SELECT count(c) FROM sbtest1 WHERE id BETWEEN 2508826 AND 2509825
SIMPLE sbtest1 null range PRIMARY PRIMARY 4 null 1838
- MariaDB 11.8.6
explain SELECT count(c) FROM sbtest1 WHERE id BETWEEN 2261014 AND 2262013
SIMPLE sbtest1 range PRIMARY PRIMARY 4 null 2032
- Postgres 18.2
explain SELECT count(c) FROM sbtest1 WHERE id BETWEEN 8688309 AND 8689308
Aggregate (cost=3675.40..3675.41 rows=1 width=8)
-> Bitmap Heap Scan on sbtest1 (cost=22.17..3673.02 rows=950 width=121)
Recheck Cond: ((id >= 8688309) AND (id <= 8689308))
-> Bitmap Index Scan on sbtest1_pkey (cost=0.00..21.93 rows=950 width=0)
Index Cond: ((id >= 8688309) AND (id <= 8689308))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment