tag:blogger.com,1999:blog-8884584404576003487.post1638850082645888153..comments2024-02-29T09:43:12.251-05:00Comments on ORACLENERD: Is DISTINCT a Bug?oraclenerdhttp://www.blogger.com/profile/12412013306950057961noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-8884584404576003487.post-74503978063435616102015-04-22T17:57:58.104-04:002015-04-22T17:57:58.104-04:00Absolutely a tool for sanity checks or for situati...Absolutely a tool for sanity checks or for situations where there is a problem with the data model - or you suspect there might be one and you need some insurance against the possibility. I'd consider it a backup plan to a good data model myself.Mike Kemphttps://www.blogger.com/profile/00358695146814491717noreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-45316675899396297782009-01-30T13:12:00.000-05:002009-01-30T13:12:00.000-05:00You can get the number of distinct values in a tab...You can get the number of distinct values in a table from the table statistics. Donno how current those are, but I'd imagine if you tell Oracle to analyze your table before looking up said statistics you should be ok.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-69046707158975410862009-01-30T01:40:00.000-05:002009-01-30T01:40:00.000-05:00Have yet to see one well designed system or applic...Have yet to see one well designed system or application or report that needs it.<BR/><BR/>Mostly, it is used as a crutch by those who don't want to bother with analyzing the data model and just want a quick "correct" result at any cost.<BR/><BR/>Everytime I see one, I see a chance for tuning.Noonshttps://www.blogger.com/profile/07694829378563989648noreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-59721584475195880362009-01-30T00:19:00.000-05:002009-01-30T00:19:00.000-05:00@gary @chrisatunityI'm glad I'm not alone there, "...@gary @chrisatunity<BR/><BR/>I'm glad I'm not alone there, "smell-test" and "spidey-senses tingling" is about how I feel.<BR/><BR/>Thanks Gary for getting into Math and stuff...taking it right over my head. ;)<BR/><BR/>Crisatunity, a tool indeed. Definitely has it's place. Just don't want to see it everywhere (unnecessarily).<BR/><BR/>I guess I've seen it used mostly by people who don't understand SQL or sets. That was probably the source of my jab above.oraclenerdhttps://www.blogger.com/profile/12412013306950057961noreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-72948954929112760412009-01-30T00:12:00.000-05:002009-01-30T00:12:00.000-05:00It puts my spider-sense on tingle. The idea is tha...It puts my spider-sense on tingle. The idea is that if it isn't there, you'll get more records. However DISTINCT doesn't prune out specific records, so it isn't really a filter. It is a set operator (like UNION, MINUS and INTERSECT). That's more 'mathematical' than I'd expect in a business context.SydOraclehttps://www.blogger.com/profile/08828771074492585943noreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-50186750283828711612009-01-29T23:39:00.000-05:002009-01-29T23:39:00.000-05:00DISTINCT is just a tool, nothing inherently wrong ...DISTINCT is just a tool, nothing inherently wrong with it. If you are using it in the context of a data access layer for your application code, then there's likely a problem.<BR/><BR/>When I see it in a view's source, that never passes the smell test.<BR/><BR/>However, all too frequently there are needs to query for sets of things that are not necessarily key-oriented and DISTINCT fills the bill nicely.Clever Idea Widgetryhttps://www.blogger.com/profile/11224068405843575576noreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-84311347226542277402009-01-29T22:55:00.000-05:002009-01-29T22:55:00.000-05:00And that was a sad swipe on my part to my QA frien...And that was a sad swipe on my part to my QA friends out there. My apologies.oraclenerdhttps://www.blogger.com/profile/12412013306950057961noreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-49126252613533765582009-01-29T22:44:00.000-05:002009-01-29T22:44:00.000-05:00OK use of DISTINCT there.Especially for our QA bre...OK use of DISTINCT there.<BR/><BR/>Especially for our QA brethren who aren't the best at SQL. ;)oraclenerdhttps://www.blogger.com/profile/12412013306950057961noreply@blogger.comtag:blogger.com,1999:blog-8884584404576003487.post-76218501811312670702009-01-29T22:36:00.000-05:002009-01-29T22:36:00.000-05:00QA folks are fond of "count distinct" when plannin...QA folks are fond of "count distinct" when planning their tests.<BR/><BR/>How many different users login every day? How many different pages do we have?Chen Shapirahttps://www.blogger.com/profile/14535067086703072776noreply@blogger.com