Skip to content

Instantly share code, notes, and snippets.

@nipunsadvilkar
Created August 17, 2017 12:07
Show Gist options
  • Save nipunsadvilkar/aa5435abaae5fec39295546747583cc4 to your computer and use it in GitHub Desktop.
Save nipunsadvilkar/aa5435abaae5fec39295546747583cc4 to your computer and use it in GitHub Desktop.
create index for mysql tables
ALTER TABLE `analytics` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY

SELECT count(distinct encounter_id) FROM `analytics`

CREATE INDEX registration_no ON analytics(registration_no(30));

CREATE INDEX subsection ON analytics(subsection(50));

CREATE INDEX fully_specified_name ON analytics(fully_specified_name(100));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment