Hello, 

 

QUESTION1: Can somebody clarify in what of the proposed scenarios is the
following index used? Any further comment will be greatly appreciated.

 

QUESTION2: Does any other scenarios when an index is NOT used (and someone
might possibly expect it is used) come to your mind? Thank you very much for
your time and wish you a happy day:-)

 

CREATE INDEX idx_margincall_bussdt ON margincall USING btree (businessdate);

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

SCENARIO 1:

select MC.IDTRADINGACCOUNT

          from MARGINCALL MC

            join DEFAULTINGACCOUNT DA on DA.BUSINESSDATE = MC.BUSINESSDATE
and DA.IDTRADINGACCOUNT = MC.IDTRADINGACCOUNT

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

SCENARIO 2:

select MC.IDTRADINGACCOUNT

          from MARGINCALL MC

where MC.BUSINESSDATE = '17.11.2008';

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

SCENARIO 3:

select MC.IDTRADINGACCOUNT

          from MARGINCALL MC

            join DEFAULTINGACCOUNT DA on DA.BUSINESSDATE = MC.BUSINESSDATE
and DA.IDTRADINGACCOUNT = MC.IDTRADINGACCOUNT

where MC.BUSINESSDATE = '17.11.2008';

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

SCENARIO 4 + QUESTION:

Is usage of indexes during execution of queries affected by db-links?

E.g.:

select MC.IDTRADINGACCOUNT

          from marginc...@db_link_name MC

where MC.BUSINESSDATE = '17.11.2008';

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Adam Slachta

 

 

Reply via email to