Artificially increasing query time

oracleperformancequery-performance

Very weird question:

Is there any way to artificially inflate the amount of time a query will take? An infinite loop would be great.

SELECT CLAIM.UNIT_PRICE FROM CLAIM WHERE CLAIM.DATE_PROCESSED>SYSDATE-10;

Needs to take enough time for our DBA to analyze something while it's running.

Best Answer

Create a table with a select * from a large table and where 1=0. Gather stats, save them using dbms_stats and then apply those stats to the large table. You will essentially tell Oracle that the large table has no data, which would favor full table scans. You can also try switching the optimizer mode to first_rows_1 or invalidating some indexes.