Query runs for hours and hours.
select v_policy_no,V_RECEIPT_NO from remt_receipt where
v_receipt_no not in (select distinct V_SOURCE_REF_NO from unmt_route_to_investment);
Table 'remt_receipt' contains 3876695 rows and 'unmt_route_to_investment' contains 2134921 rows. The explain plan for the above query is as follows:
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 3652420855
-----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 3874K| 62M | 9554M (1) |999:59:59 |