Skip to content

Instantly share code, notes, and snippets.

@artemeff
Created March 22, 2021 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artemeff/a09e9dffdcf7b3944f12250bade19982 to your computer and use it in GitHub Desktop.
Save artemeff/a09e9dffdcf7b3944f12250bade19982 to your computer and use it in GitHub Desktop.
debug sql indexes performance in production using transactions
BEGIN;
drop index <IDX_NAME>;
create index test_1 on <TABLE> (...);
create index test_2 on <TABLE> (...) where field = true;
EXPLAIN ANALYZE <QUERY>
ROLLBACK;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment