Skip to content

Instantly share code, notes, and snippets.

@reinislejnieks
Created August 9, 2018 10:12
Show Gist options
  • Save reinislejnieks/c446eecd1128fcb927bf6ffb2954c362 to your computer and use it in GitHub Desktop.
Save reinislejnieks/c446eecd1128fcb927bf6ffb2954c362 to your computer and use it in GitHub Desktop.
/*
Indexes are best used on columns that are frequently used in where clauses, and in any kind of sorting, such as "order by".
If we assign ID as a primary key, we don't need one there.
*/
CREATE INDEX tablename_columnname_idx
ON tablename (columnname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment