Can you post your entire sql. Are the tables being used IOT or normal table.