Skip to content

Instantly share code, notes, and snippets.

@hmcfletch
Created May 10, 2011 23:55
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 hmcfletch/965645 to your computer and use it in GitHub Desktop.
Save hmcfletch/965645 to your computer and use it in GitHub Desktop.
A list of helpful SQL queries
-- Show the coverage of a partial index
SELECT COUNT(DISTNICT(SUBSTR(<column>,1,<partial index length>))) / COUNT(DISTINCT(<column>)) * 100 FROM <table>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment