Re: Join Cardinality

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 31 May 2019 19:00:44 +0000
Message-ID: <LO2P265MB0415BEC1E89443F88BFAAB27A5190_at_LO2P265MB0415.GBRP265.PROD.OUTLOOK.COM>


Thumbnail sketch - which wasn't in the book, but is described in detail by Alberto Dell'Era.

If you have other predicates on the table then the "ndv" in the formula is not the num_distinct from user_tab_cols, it is an adjusted figure that answers the question:

"How many distinct value am I likely to see in the subset of rows identified by the other predicates?"

For example: if I have 1M rows in the table with 2000 distinct values in column X and some other predicates on the table identify 2,500 rows from the table, how many of the 2,000 possible values are likely to show up in the 2,500 rows selected.

Regards
Jonathan Lewis



From: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> on behalf of Patrick Jolliffe <jolliffe_at_gmail.com> Sent: 31 May 2019 12:03:51
To: Sayan Malakshinov
Cc: Stefan Koehler; oracle-l
Subject: Re: Join Cardinality

Thanks both, let me try and follow up over the weekend. Stefan,
Maybe it's cos I'm tired, but I could see the SWRU referenced and used throughout the paper, but I couldn't actually find the definition of the SWRU function, Am I missing something?
Patrick

On Fri, 31 May 2019 at 18:59, Sayan Malakshinov <xt.and.r_at_gmail.com<mailto:xt.and.r_at_gmail.com>> wrote: Hi Patrick,

JSEL should be 1/50, since you already filtered T1 ("T1"."RAND20"=1) and got 50 rows

--

Best regards,
Sayan Malakshinov
Oracle performance tuning engineer
Oracle ACE Associate
http://orasql.org
--

http://www.freelists.org/webpage/oracle-l Received on Fri May 31 2019 - 21:00:44 CEST

Original text of this message