The first thing you should check is the execution plan after you have created your small tables. Are there indexes? Are they useful? If your plan creates three table scans that is one of the first things to fix.
Quand on parle du loup, on en voit la queue