Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  MySQL index optimization

Problem description:We need to access a very big table which has 40 million records. In the table, id is the primary key and program_id is indexed.When executing a select query:select * from program_access_log where program_id between 1 and 4000The above query executes very slowly, we thought it was because there were too many records in the table. So we added id in the where condition to limit the search so that each time only half a million records would be read.select * from program_access_log where id between 1 and 500000 and program_id between 1 and 4000But this query is st...

4,473 0       MYSQL INDEX SEARCH PARTITION