Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    7

    Question Unanswered: Union Quert with DB links

    I have two sites with the same table.
    Both have the same indexes on that table.

    I want to Query - using an index. On both the tables.

    My Query is:


    Select id1 , count(*)
    from
    (Select id2 as id1 , count(*)
    From T1
    UNION ALL
    Select id3 as id1 , count(*)
    from T1@site2)
    Where id1= 4


    Will the index available on site2 be used correctly and only the records that
    Answer the filter will be sent via the network ?
    I know that using this tmplate of query where both tables are on the same Db
    The index is used.

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    You should be fine...
    To prove it ... set tracing on
    sql> set autotrace trace
    sql> your query

    See what explain plan tells you ...

    Gregg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •