There Is No Time Like ‘%NOW%’ To Use Dynamic Sampling
March 5, 2008I recently came across a query in which the Optimizer was making a poor cardinality estimate, which in turn caused inefficient join type, which in turn caused the query to run excessively long. This post is a reenactment of my troubleshooting. The Suspect SQL The original SQL was quite large and had a fairly complex plan so I simplified it down to this test case for the purpose of this blog post: [sourcecode language='sql']select [...] from fact_table al1 where al1.region = '003' and al1.order_type = 'Z010' and al1.business_type ...