DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Bind variables slowing the query?

  1. #1
    Join Date
    Oct 2005
    Posts
    2

    Bind variables slowing the query?

    I have a wierd query that is generated by a third party tool(this is an generated query to talk to siebel).

    This is a big query, but ends like.

    (T7.ROW_ID LIKE :1) AND
    (T4.ASSET_ID = :2)

    and the :1 will be replaced by % and :2 is replaced by a valid row_id at runtime.

    This query takes about 3 min to execute and return one row of values. But when we directly place the values in the query like

    (T7.ROW_ID LIKE '%') AND
    (T4.ASSET_ID = 'XYZ' )
    The execution takes a few milliseconds. We are using oracle 9.2.0.1

    any ideas why this could happen?

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    histograms? how skewed is your data

  3. #3
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    There's surely a different execution plan going on here. It seems like it would be worth investigating optimizer plan stability
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  4. #4
    Join Date
    Oct 2005
    Posts
    2
    hi slimdave,
    I ran explain plan for both the types and its different. and that explains the problem. I did not think if that could be the case as i am pretty new at this Oracle performance stuff.

    I will try to check about optimizer plan stability.
    thanks a ton.

Posting Permissions

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


Click Here to Expand Forum to Full Width