HI,
May I know what is the database you are using? How large is the resultset?
My suggestion is, try to filter any unecessary data instead of download ALL records which JOIN this 3 tables.
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...