Other
Mysql optimize
smalest data type
horizon : split many columned table
vertical: split many rowed table
alway:
fewer read= faster result
———————
Coding guideline:
- KISS(keep it simple stupid)
-Using store procedure for a big performance boost
-isolate index fields in one side of equation
(ex:
bad: where TO_DAYS(created_date) – TO_DAYS(CURRENT_DATE() >7
better: where created_date > CURRENT_DATE() – INTERVAL 7 DAY
best: calculate CURRENT_DATE() – INTERVAL 7 DAY ->replace by a const!
)
-convert correlated sub queries- >standard join


