Skip to content

Instantly share code, notes, and snippets.

@workmaster2n
Created April 19, 2012 22:37
Show Gist options
  • Save workmaster2n/2424671 to your computer and use it in GitHub Desktop.
Save workmaster2n/2424671 to your computer and use it in GitHub Desktop.
explain
mysql> EXPLAIN EXTENDED SELECT `players_to_teams`.`id` AS t0_r0, `players_to_teams`.`IsActive` AS t0_r1, `players_to_teams`.`IsVisible` AS t0_r2, `players_to_teams`.`player_id` AS t0_r3, `players_to_teams`.`team_id` AS t0_r4, `players_to_teams`.`CreationDate` AS t0_r5, `players_to_teams`.`Position` AS t0_r6, `players_to_teams`.`Number` AS t0_r7, `players_to_teams`.`Club` AS t0_r8, `players_to_teams`.`BT` AS t0_r9, `players_to_teams`.`BioLink` AS t0_r10, `players_to_teams`.`OtherBioLink` AS t0_r11, `players_to_teams`.`StartYear` AS t0_r12, `players_to_teams`.`EndYear` AS t0_r13, `players_to_teams`.`NeulionPlayerID` AS t0_r14, `players_to_teams`.`SeasonYear` AS t0_r15, `players_to_teams`.`GamesPlayed` AS t0_r16, `players_to_teams`.`created_at` AS t0_r17, `players_to_teams`.`updated_at` AS t0_r18, `players_to_teams`.`account_id` AS t0_r19, `players_to_teams`.`account_name` AS t0_r20, `players`.`id` AS t1_r0, `players`.`IsActive` AS t1_r1, `players`.`IsVisible` AS t1_r2, `players`.`FirstName` AS t1_r3, `players`.`LastName` AS t1_r4, `players`.`HeightFeet` AS t1_r5, `players`.`HeightInches` AS t1_r6, `players`.`Weight` AS t1_r7, `players`.`Birthday` AS t1_r8, `players`.`Gender` AS t1_r9, `players`.`HometownCity` AS t1_r10, `players`.`HometownState` AS t1_r11, `players`.`HometownZip` AS t1_r12, `players`.`HometownCountry` AS t1_r13, `players`.`HighSchoolId` AS t1_r14, `players`.`HighSchoolIdTemp` AS t1_r15, `players`.`HighSchoolGradYear` AS t1_r16, `players`.`CollegeYear` AS t1_r17, `players`.`Redshirted` AS t1_r18, `players`.`Transferred` AS t1_r19, `players`.`CollegeId` AS t1_r20, `players`.`CollegeIdTemp` AS t1_r21, `players`.`CollegeGradYear` AS t1_r22, `players`.`OtherAccountId` AS t1_r23, `players`.`PreviousCollegeId` AS t1_r24, `players`.`CurrentTeamId` AS t1_r25, `players`.`LateralRecommendationReason` AS t1_r26, `players`.`LateralRecommendationLink` AS t1_r27, `players`.`CreationDate` AS t1_r28, `players`.`CreatedBy` AS t1_r29, `players`.`LastModifiedDate` AS t1_r30, `players`.`LastModifiedBy` AS t1_r31, `players`.`TwitterLink` AS t1_r32, `players`.`FacebookLink` AS t1_r33, `players`.`PersonalWebsite` AS t1_r34, `players`.`PlayerImage` AS t1_r35, `players`.`FirstNameNickName` AS t1_r36, `players`.`NeulionID` AS t1_r37, `players`.`OtherTeamID` AS t1_r38, `players`.`OtherSportTypeID` AS t1_r39, `players`.`SourceDataTypeID` AS t1_r40, `players`.`PlayerTypeID` AS t1_r41, `players`.`LoadID` AS t1_r42, `players`.`SameNameTeammate` AS t1_r43, `players`.`SameNameSchoolMate` AS t1_r44, `players`.`SD_SportID` AS t1_r45, `players`.`SD_PlayerID` AS t1_r46, `players`.`ZeroNCAAStats` AS t1_r47, `players`.`ModifiedByPythonGame` AS t1_r48, `players`.`Missing2011` AS t1_r49, `players`.`Transfer2011` AS t1_r50, `players`.`RecruitingClass` AS t1_r51, `players`.`created_at` AS t1_r52, `players`.`updated_at` AS t1_r53, `players`.`height_in_inches` AS t1_r54, `players`.`highschool_id` AS t1_r55, `players`.`highschool_name` AS t1_r56, `teams`.`id` AS t2_r0, `teams`.`IsActive` AS t2_r1, `teams`.`IsVisible` AS t2_r2, `teams`.`AccountId` AS t2_r3, `teams`.`AccountIdTemp` AS t2_r4, `teams`.`Name` AS t2_r5, `teams`.`SportTypeId` AS t2_r6, `teams`.`ConferenceId` AS t2_r7, `teams`.`Division` AS t2_r8, `teams`.`NationalRanking` AS t2_r9, `teams`.`CreationDate` AS t2_r10, `teams`.`CreatedBy` AS t2_r11, `teams`.`LastModifiedDate` AS t2_r12, `teams`.`LastModifiedBy` AS t2_r13, `teams`.`LeagueID` AS t2_r14, `teams`.`ChildConferenceID` AS t2_r15, `teams`.`Show` AS t2_r16, `teams`.`NextLevel` AS t2_r17, `teams`.`HomeVenue` AS t2_r18, `teams`.`SD_SportID` AS t2_r19, `teams`.`SD_SportName` AS t2_r20, `teams`.`SD_LeagueID` AS t2_r21, `teams`.`SD_LeagueName` AS t2_r22, `teams`.`SD_TeamID` AS t2_r23, `teams`.`LoadID` AS t2_r24, `teams`.`RosterLink` AS t2_r25, `teams`.`ScheduleLink` AS t2_r26, `teams`.`created_at` AS t2_r27, `teams`.`updated_at` AS t2_r28, `teams`.`account_id` AS t2_r29, `accounts`.`id` AS t3_r0, `accounts`.`AccountId` AS t3_r1, `accounts`.`AccountIdTemp` AS t3_r2, `accounts`.`HighSchoolTempId` AS t3_r3, `accounts`.`IsActive` AS t3_r4, `accounts`.`IsVisible` AS t3_r5, `accounts`.`IsPaidAd` AS t3_r6, `accounts`.`boolean` AS t3_r7, `accounts`.`Name` AS t3_r8, `accounts`.`CommonName` AS t3_r9, `accounts`.`ShortName` AS t3_r10, `accounts`.`AbbreviatedName` AS t3_r11, `accounts`.`OtherName` AS t3_r12, `accounts`.`NickName` AS t3_r13, `accounts`.`FemaleNickName` AS t3_r14, `accounts`.`KeywordAlias` AS t3_r15, `accounts`.`AccountTypeId` AS t3_r16, `accounts`.`TribuneName` AS t3_r17, `accounts`.`Division` AS t3_r18, `accounts`.`ConferenceId` AS t3_r19, `accounts`.`Address` AS t3_r20, `accounts`.`AddressLine2` AS t3_r21, `accounts`.`City` AS t3_r22, `accounts`.`State` AS t3_r23, `accounts`.`Zip` AS t3_r24, `accounts`.`Zip4` AS t3_r25, `accounts`.`Country` AS t3_r26, `accounts`.`Website` AS t3_r27, `accounts`.`VideoLink` AS t3_r28, `accounts`.`SiteProvider` AS t3_r29, `accounts`.`VideoProvider` AS t3_r30, `accounts`.`Latitude` AS t3_r31, `accounts`.`Longitude` AS t3_r32, `accounts`.`TimeZone` AS t3_r33, `accounts`.`Colors` AS t3_r34, `accounts`.`Logo` AS t3_r35, `accounts`.`LogoImage` AS t3_r36, `accounts`.`MonthlyFee` AS t3_r37, `accounts`.`AnnualFee` AS t3_r38, `accounts`.`RadioStation` AS t3_r39, `accounts`.`TVStation` AS t3_r40, `accounts`.`TicketOfficeLink` AS t3_r41, `accounts`.`TicketOfficePhone` AS t3_r42, `accounts`.`DST` AS t3_r43, `accounts`.`Mascot` AS t3_r44, `accounts`.`NCES_PSS_Id` AS t3_r45, `accounts`.`County` AS t3_r46, `accounts`.`CountyFipsId` AS t3_r47, `accounts`.`Phone` AS t3_r48, `accounts`.`PublicSchool` AS t3_r49, `accounts`.`LocaleCode` AS t3_r50, `accounts`.`NumberOfStudents` AS t3_r51, `accounts`.`Enrollment_9to12` AS t3_r52, `accounts`.`MaleStudents` AS t3_r53, `accounts`.`FemaleStudents` AS t3_r54, `accounts`.`Coed` AS t3_r55, `accounts`.`LowestGradeLevel` AS t3_r56, `accounts`.`HighestGradeLevel` AS t3_r57, `accounts`.`Title1` AS t3_r58, `accounts`.`SchoolType` AS t3_r59, `accounts`.`SEC_Comb` AS t3_r60, `accounts`.`Affiliation` AS t3_r61, `accounts`.`SearchSortorder` AS t3_r62, `accounts`.`CreationDate` AS t3_r63, `accounts`.`CreatedBy` AS t3_r64, `accounts`.`LastModifiedDate` AS t3_r65, `accounts`.`LastModifiedBy` AS t3_r66, `accounts`.`CompName` AS t3_r67, `accounts`.`Show` AS t3_r68, `accounts`.`created_at` AS t3_r69, `accounts`.`updated_at` AS t3_r70 FROM `players_to_teams` LEFT OUTER JOIN `players` ON `players`.`id` = `players_to_teams`.`player_id` LEFT OUTER JOIN `teams` ON `teams`.`id` = `players_to_teams`.`team_id` LEFT OUTER JOIN `accounts` ON `accounts`.`id` = `teams`.`account_id` WHERE `teams`.`SportTypeId` = 1 ORDER BY players.LastName LIMIT 20 OFFSET 0\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: teams
type: ref
possible_keys: PRIMARY,sport_type_id
key: sport_type_id
key_len: 5
ref: const
rows: 1014
filtered: 100.00
Extra: Using where; Using temporary; Using filesort
*************************** 2. row ***************************
id: 1
select_type: SIMPLE
table: accounts
type: eq_ref
possible_keys: PRIMARY,id_name
key: PRIMARY
key_len: 4
ref: mysql_development.teams.account_id
rows: 1
filtered: 100.00
Extra:
*************************** 3. row ***************************
id: 1
select_type: SIMPLE
table: players_to_teams
type: ref
possible_keys: FK_players_to_teams_team
key: FK_players_to_teams_team
key_len: 5
ref: mysql_development.teams.id
rows: 33
filtered: 100.00
Extra: Using where
*************************** 4. row ***************************
id: 1
select_type: SIMPLE
table: players
type: eq_ref
possible_keys: PRIMARY
key: PRIMARY
key_len: 4
ref: mysql_development.players_to_teams.player_id
rows: 1
filtered: 100.00
Extra:
4 rows in set, 1 warning (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment