sql - Big Mysql table optimization -
i have table use cache google translate api answers. table structure
now has more 1million rows 35000 distinct values in group
field. query type use is:
select `orig_string`, `group`, `translated` `google_translate_cache` (`group` = "?" , ((`orig_string` = "?") or (`orig_string` = "?") or (`orig_string` = "?") ....
now every query take more 2 seconds.
i have tried change query union
one, result same.
in addition tried partition table -
alter table `google_translate_cache` partition key(`orig_string`) partitions 26;
but not successful.
any suggestion speed it?
i may wrong, don't think partitioning of table on "orig_string" want. instead, compound index on (group, orig_string) optimize where clause qualifier. now, group column -- 255 capacity? large required when original string being tested maxes out @ 100? having index of might cause bit of lag, cant definitively lack of knowledge of actual content.
i start compound index , not partition in way indicated.
Comments
Post a Comment