Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SYSDATE vs CURRENT_DATE (execution path changes from 363,900 to 20,325)

761812Mar 22 2010 — edited Jun 14 2010
Hi.

If I use as a predicate :

ety.ety_registration_date >= current_date-10

then my explain plan cost is 363,900

If I use ety.ety_registration_date >= sysdate-10

then the plan cost is 20,325.

Quite the difference.

Can anyone explain to me what the difference is between these functions? And why it should so utterly alter the optomised plan.


Below is the full query:

select mtr.mtr_current_version
,eas_rte_code as display_name
, ads.ads_discriminant
, ads_address_1 || ', ' || ads_address_2 || ', ' || ads_address_3 || ', ' || ads_address_4 as address
, mtr.mtr_identifier
from gv_emr_entity_master mtr
, gv_ety_entities gv_ety
,gm_ety_entities ety
, gv_eas_entity_addresses eas
, gm_ads_addresses ads
-- MASTER TO GV_ETY
where mtr.mtr_identifier = gv_ety.ety_entity_identifier
and mtr.mtr_current_version = gv_ety.ety_ety_version
-- GV_ETY to GM_ETY
and gv_ety.ety_id = ety.ety_id
-- GV_ETY to GV_EAS
and gv_ety.ety_entity_identifier = eas.eas_entity_identifier
and gv_ety.ety_ety_version = eas.eas_ety_version
-- GV_EAS to GM_ADS
and eas.eas_ads_id = ads.ads_id
-- PREDICATES
and
ety.ety_registration_date >= sysdate-10;
--ety.ety_registration_date >= current_date-10;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2010
Added on Mar 22 2010
6 comments
11,076 views