Tracing
Date: Thu, 19 Nov 2009 08:45:49 -0800 (PST)
Message-ID: <aba43c50-4a32-491a-9eb2-c5139e5325c9_at_j14g2000yqm.googlegroups.com>
Hi,
When tracing SQL statements from SQLPLUS to see consistent gets and such, if the query contains bind variables or constants, how do you 'emulate' that in SQLPLUS and perform the trace? Here is an example:
This is in one of our stored procedures. It does 5500 consistent gets. I want to try and bring that down, but, I'm thinking I can't because of the literals. If I change those to bind variables as well as the 237 constant, how can I trace that from SQLPLUS?
SELECT subgroup_id, max_allowed_subscr, allow_new_subscriptions,
priority
FROM (SELECT ts.subgroup_id, max_allowed_subscr,
allow_new_subscriptions, priority, COUNT(ts.subgroup_id)
OVER (PARTITION BY ts.subgroup_id, ts.newsletter_id) number_in_group, ROW_NUMBER()
OVER (PARTITION BY ts.subgroup_id, ts.newsletter_id ORDER BY priority) rnum
FROM engine.ts_subgroups ts, engine.ts_customers tc, engine.customer_order co,
engine.order_line ol, engine.product p WHERE ts.subgroup_id = tc.subgroup_id AND tc.customer_id = co.customer_id AND co.order_id = ol.order_id AND ol.product_id = p.product_id AND ol.status IN ('Active','Pending') AND p.subproduct_id = 237 AND ts.newsletter_id = 237)
WHERE rnum = 1; Received on Thu Nov 19 2009 - 10:45:49 CST