Quote Originally Posted by Shaggy Hiker View Post
I don't know MySQL, but I would expect that it has indexes. Do you have indexes on the relevant fields? The only relevant field from your example appears to be id_planoconta. If you do have an index, is it badly fragmented? With so few records, it might not matter much, but badly fragmented indexes can wreck query performance.
That field is probably a foreign key to table1 and has no automatic index.
but agreed: create an index consisting of both fields: foreign and primary key