A query slows down very much after adding a new field to the table
I have converted a project from an old report program (Visual Fox Pro running on Windows 2003 installed with Oracle ODBC components communicating to Oracle 11g 64bit database running on Windows 200864bitR2) to a newer platform using ASP.NET based project. The project was completed a month ago, and the only thing that holds up is the run time of the report.
After stepping through the program codes in Visual Studio 2012, I have narrowed down to the SQL statements that pass to the Oracle database causing the delay.
I was able to replicate the same issue by extracting one of the sql statements and execute it with Oracle Developer. I need a little help here because I ran a comparison and both statements are almost exactly the same except the newer one has an additional userid in the table. Also, I have already added index on this field to the table already. Script #1 ran 10 secs (doesn’t matter how many times I run), but #2 ran 70sec in the first run(5 seconds in the second run). Since there are about 12 statements like this in the program