I send a lot of request during a second to the database in a following pattern:
name1 | name2 | time
aaa bbb 5
aaa bbb 2
ccc ddd 3
name1-name2
is a composite key, there are maybe 10 combinations of those, and more than a million records in a table.
Now, because these are strings, it's really slow to select something from that. I've been thinking about converting this composite key to some integer to speed it up, and make it one column instead of two.
Will this really speed up my database?
How can I convert this composite key to achieve this?