sql - Is normal MySql index required when we have Composite index -


we have mysql table having 25 million rows

following columns in table

c_id,c_name,s_id,l_type,l_time,message,domain 

among above have normal indexes on c_id,c_name,s_id,l_type,domain columns

i'm planning add composite index on domain, l_time, l_type columns. can remove individual index on domain?

thanks

any prefix of composite index used index well. if have composite index on (domain, log_time, log_type), it's equivalent having indexes on domain , (domain, log_time). there's no need have these indexes separately well, redundant , waste space.

so can safely remove index on domain when add composite index.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -