-2
Guys, I got one query
here very simple with JOIN
, Because banks have a lot of records, I need to index...
But I’m getting it for kct... What is the best way to index in a JOIN
? (That one query
takes 0.26)
SELECT r.* FROM rooms r JOIN users u ON r.owner=u.id WHERE u.id='697' LIMIT 50;
I have made the following indexs:
CREATE INDEX idx_users ON users(username);
CREATE INDEX idx_own ON rooms(owner);
But no results whatsoever... How to proceed?
The only way I imagine, is if the Owner in Rooms and id in users are indices, because username, has no indexing effect in this context.
– Luis Alberto Batista