Skip to content

Instantly share code, notes, and snippets.

@eneko
Last active November 30, 2016 06:17
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 eneko/24a5897114911a1156176e31d386d257 to your computer and use it in GitHub Desktop.
Save eneko/24a5897114911a1156176e31d386d257 to your computer and use it in GitHub Desktop.
Ergast MySQL indices
-- Constructor Standings
alter table constructorstandings add index (constructorid);
alter table constructorstandings add index (raceid);
alter table constructorstandings add unique index constructorrace (constructorid, raceid);
-- Drivers
alter table drivers add unique index driverref (driverref);
-- Driver Standings
alter table driverstandings add index (driverid);
alter table driverstandings add index (raceid);
alter table driverstandings add uniqueindex driverrace (driverid, raceid);
-- Races
alter table races modify column `date` DATE not null default '1900-01-01';
alter table races add unique index yearround (year, round);
-- Results
alter table results add index (position);
alter table results add index (grid);
alter table results add index (driverid);
alter table results add index (constructorid);
alter table results add index (raceid);
alter table results add index driverrace (driverid, raceid);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment