tag:blogger.com,1999:blog-5184817680153868582024-02-19T01:33:14.761-05:00Karen MortonMeanderings of one who is lucky enough to have her avocation be her vocation.Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.comBlogger166125tag:blogger.com,1999:blog-518481768015386858.post-82954103633245403102015-01-26T13:12:00.001-05:002015-01-26T13:12:39.904-05:00Find it. Fix it. Real-World SQL Tuning Cases - Jan. 13 Webinar FollowupIf you missed my January 13th webinar entitled "Find it. Fix it. Real-World SQL Tuning Cases" you can now access the recording and download the presentation file using the following links.<br /><br />
<a href="https://dl.dropboxusercontent.com/u/56955046/webinars/2015-01-13-Find-It-Fix-It.pdf" target="_blank">Presentation PDF</a><br />
<a href="http://forms.embarcadero.com/Real-World-SQL-Tuning-Cases" target="_blank">Webinar recording</a> <br />
<br />
<iframe width="640" height="390" src="//www.youtube.com/embed/sIHvOySgkSY" frameborder="0" allowfullscreen></iframe>
<br />
<br />
<br />
<b>Abstract</b><br />
There are many ways to find SQL that is performing poorly. The hard part is what to do with a bad SQL statement once you have it. In this session, several real-world examples will be reviewed to help you learn how to evaluate poorly performing SQL. Each example will demonstrate a commonly occurring SQL performance problem and provide a method to solve it.<br />
<br />
Key points:<br />
1. Review ways to identify poorly performing SQL.<br />
2. Learn a simple method for evaluating a problem SQL statement.<br />
3. Identify key performance inhibitors in SQL execution plans.<br />
4. Determine the best and simplest solution.<br />
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-90840786030405026982014-11-23T14:47:00.000-05:002014-11-23T14:47:22.497-05:00Webinar Followup (Nov. 12) - In Search of Plan Stability - Part 2Sorry for the delay in getting this posted, but thanks to everyone who attended my November 12th webinar entitled In Search of Plan Stability - Part 2. You can download the presentation materials from these links:<br />
<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/webinars/2014-11-12-In-Search-of-Plan-Stability-2.pdf" target="_blank">Presentation PDF</a><br />
<a href="https://dl.dropboxusercontent.com/u/56955046/webinars/2014-11-12-In-Search-of-Plan-Stability-Part-2-recording.mp4" target="_blank">Recording</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dwq0fUEPd-S38f9oOlcuAYdLqILvXRQhcf02rZOkMg4ACNLjJ-gMhPUNWPuJ-0Us4hEerr0COjPPkl11XRD2A' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<br />
<br />
<br />
<br />
Thanks!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-8143463679999452552014-09-17T10:46:00.002-04:002014-09-17T10:46:51.061-04:00Blog articles at Toad World<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj397htMxG8Ahv5lo7dXM9GOh70nO8a6sEGGUgs-xLkD9-e-aKLCuoDm-J7M6V3UFYFudATAYkLY0io0gBVQARGx2g7v3FJ5QncuhIhZDLWkv3NKJnnnY2rYT9LT2XjjelsS6_jXTalzoM/s1600/toad-world-logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj397htMxG8Ahv5lo7dXM9GOh70nO8a6sEGGUgs-xLkD9-e-aKLCuoDm-J7M6V3UFYFudATAYkLY0io0gBVQARGx2g7v3FJ5QncuhIhZDLWkv3NKJnnnY2rYT9LT2XjjelsS6_jXTalzoM/s1600/toad-world-logo.png" height="63" width="320" /></a></div>
<br />
I just wanted to point you to the blog articles I've been posting over at Toad World in case you're wondering why there aren't many articles showing up here.<br />
<br />
So, go take a look!<br />
<br />
<a href="http://www.toadworld.com/members/karen.r.morton/blogs/default.aspx" target="_blank">Karen's Toad World Blog</a>Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com2tag:blogger.com,1999:blog-518481768015386858.post-64606709139061411712014-08-29T09:50:00.000-04:002014-09-30T10:05:52.614-04:00Webinar Followup (Aug. 27): In Search of Plan Stability - Part 1Thanks to everyone who attended my August 27th webinar entitled In Search of Plan Stability - Part 1. You can download the presentation materials from these links:<br />
<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/webinars/2014-08-27-In-Search-of-Plan-Stability-1.pdf" target="_blank">Presentation PDF</a><br />
<a href="https://dl.dropboxusercontent.com/u/56955046/webinars/2014-08-27-scripts.zip" target="_blank">Scripts</a><br />
<a href="https://dl.dropboxusercontent.com/u/56955046/webinars/2014-08-27-q-and-a.txt" target="_blank">Q&A</a><br />
<a href="https://dl.dropboxusercontent.com/u/56955046/webinars/2014-08-27-In-Search-of-Plan-Stability-1-recording.mp4" target="_blank">Recording</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dyXi8Atw7HlsOrWDXjNs_6GHAD-Dd1XQ5zysdc2Rc1J7IOF1pAxU06dVMrzp1wOrpTyms2yLhvfEmNxcOyr5A' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<br />
<br />
Come back in November for Part 2. Hope to see you then!<br />
<br />
Thanks!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-59098530727228271262014-08-18T17:04:00.000-04:002014-08-18T17:04:12.074-04:00In Search of Plan Stability (Part 1) - August 27 webinar<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghzPGpGcjODO-qH47IZKLPJ1V0iPUvh2-cZYzBYErDrHTQFS-zOFL5wmKzzWHKVD6Q-fUL1T3xw26VKhZvSfPhiLP4Ca4FtDrdbP9qVSRtgWJsZV08p2XdLNRqkn23zk9QXEixm6GiQig/s1600/aug-27-webinar.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghzPGpGcjODO-qH47IZKLPJ1V0iPUvh2-cZYzBYErDrHTQFS-zOFL5wmKzzWHKVD6Q-fUL1T3xw26VKhZvSfPhiLP4Ca4FtDrdbP9qVSRtgWJsZV08p2XdLNRqkn23zk9QXEixm6GiQig/s1600/aug-27-webinar.jpg" height="392" width="640" /></a></div>
<br />
<br />
Register by clicking <a href="https://www1.gotomeeting.com/register/250535689" target="_blank">here</a>.<br />
<br />
Hope you'll join me!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-89777146652616327742014-08-13T16:02:00.004-04:002014-08-13T16:02:59.048-04:00New Oracle Bug alert (Bug 19384287) Heads up to all the folks running 11.2.0.4 and above if you're using function-based indexes! There's a new <a href="https://support.oracle.com/epmos/faces/BugDisplay?_afrLoop=397801310965301&id=19384287&_afrWindowMode=0&_adf.ctrl-state=7o8kmkec_68" target="_blank">Oracle bug 19384287</a>. I'll fill you in with a <a href="http://www.toadworld.com/platforms/oracle/b/weblog/archive/2014/08/13/new-oracle-bug-alert.aspx" target="_blank">complete post over at Toad World</a>.Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-45896803860386574352014-06-26T15:17:00.000-04:002014-06-26T15:17:14.245-04:00Young Programmer's CampI made a <a href="http://www.toadworld.com/platforms/oracle/b/weblog/archive/2014/06/26/programming-for-the-future.aspx" target="_blank">short post over at ToadWorld</a> about bringing my nephew to my office in Dallas this week for a Young Programmer's camp. He had a great time as far as I could gauge the excitement of a 16 year old boy (errrrrr....young man)! He rocked it out creating several different game knock-offs and got a feel for what it would be like to be a software developer. Fun stuff!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOUEBx32ckDu75dTml63KJOfTZBRsba6rbphr-7kq9YJOezS-TtT2Xfv1lGL4gnH94LBKHmRLQSux5l3RYNfOP3DqHtSZuAqddAezh-v1E7v8hWPMYmpZxcnvOkLTQNf8ehO3wOAgv244/s1600/josh-at-camp.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOUEBx32ckDu75dTml63KJOfTZBRsba6rbphr-7kq9YJOezS-TtT2Xfv1lGL4gnH94LBKHmRLQSux5l3RYNfOP3DqHtSZuAqddAezh-v1E7v8hWPMYmpZxcnvOkLTQNf8ehO3wOAgv244/s1600/josh-at-camp.jpg" height="320" width="240" /></a></div>
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-19504962836086482752014-06-26T15:13:00.004-04:002014-06-26T15:13:34.736-04:00Tracing Code with DBMS_MONITORTake a look at the follow-up to my DBMS_APPLICATION_INFO post over at ToadWorld. I discuss how to use DBMS_MONITOR to trace the specific sections of code you registered with DBMS_APPLICATION_INFO. <div>
<br /></div>
<div>
<a href="http://www.toadworld.com/platforms/oracle/b/weblog/archive/2014/06/22/tracing-code-with-dbms-monitor.aspx" target="_blank">Full article here</a></div>
Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-28735424079938916552014-06-17T10:01:00.004-04:002014-06-17T10:01:52.457-04:00Instrumenting Your Code using DBMS_APPLICATION_INFO<div>
Head on over to my <a href="http://www.toadworld.com/platforms/oracle/b/weblog/archive/2014/06/17/instrumenting-your-code-using-dbms-application-info.aspx" target="_blank">post at Toad World</a> to read all the details about instrumenting your code with DBMS_APPLICATION_INFO.</div>
<div>
<br /></div>
<div>
<br /></div>
Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-3728509692495819302014-06-16T18:34:00.002-04:002014-06-16T18:34:20.128-04:00Blogging at Toad WorldIn order to help me stick to my commitment to blog more regularly, I've joined the blogging community at Toad World. I'll link to most posts from there as I make them (I love knocking down two targets with one arrow) and keep on track for at least one post a week moving forward. Yea!<div>
<br /></div>
<div>
You can read my brief hello over at Toad World <a href="http://www.toadworld.com/platforms/oracle/b/weblog/archive/2014/06/16/hello-world-i-mean-toad-world.aspx" target="_blank">here</a>. Stay tuned in the weeks ahead for a series of posts on Oracle performance, SQL and the optimizer. I'm going to start with a few posts on code instrumentation and move on to cover many of the suggested topics I received from you all. </div>
<div>
<br /></div>
<div>
Cheers!</div>
Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-70794686555389132062014-05-28T13:49:00.000-04:002014-05-28T13:49:26.371-04:00Weekly posts - Anyone got any ideas?I've decided to get back in the groove of making more regular blog posts and have an intention to blog at least once a week in the coming months to get myself back in the habit. While I always seem to have a head full of stuff that never makes it to the blog, I thought I'd ask you all if you have any topic suggestions?<br />
<br />
At this point in time, I'm not sure anyone drops by here much since my posts have been mainly announcing webinars and providing follow-ups. But, I figured I'd put it out there and see if anyone still has their ears on. :) So, if you've got something you'd like to hear about, leave me a comment and I'll see if I can supply something suitable.<br />
<br />
If I don't get any suggestions, I'll just ramble on what happens to be in the front of my brain at the moment. :)<br />
<br />
Cheers everyone!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com7tag:blogger.com,1999:blog-518481768015386858.post-63726703303469825602014-05-20T15:21:00.002-04:002014-05-28T14:07:25.843-04:00Writing SQL Right - May 20 webinar wrap-upThanks to everyone for attending today's Writing SQL Right webinar sponsored by Embarcadero. For attendees, Embarcadero will send out a link via email to the recording and PDF of the presentation, but I also wanted to post it here.<br />
<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/2014-05-20-Writing-SQL-Right-Antipatterns.pdf">Presentation PDF</a><br />
<a href="http://youtu.be/RMc144FtvKo" target="_blank">Webinar recording</a> <br />
<br />
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/RMc144FtvKo?feature=player_detailpage" width="640"></iframe>
<br />
<br />
Thanks again and stay tuned for additional webinars coming soon!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-46302635648288460692014-05-02T12:21:00.001-04:002014-05-02T12:21:38.472-04:00Upcoming Webinar: Writing SQL Right on May 20Coming up on May 20, I'll be delivering a webinar entitled Oracle SQL Performance: Writing SQL Right. <a href="http://forms.embarcadero.com/OracleSQLPerformance_WritingSQLRight?cid=701G0000000XD6L">Registration</a> is now open. Once again the webinar will be hosted by Embarcadero and there will be two sessions - one at 10am ET and one at 2pm ET.<br />
<br />
<a href="http://forms.embarcadero.com/OracleSQLPerformance_WritingSQLRight?cid=701G0000000XD6L"><img style="border:0; margin-left: 1em; margin-right: 1em;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnKx2IG7KOp8wjrksIQvZS603IQwMYZTCcYLLYxmEcin8xKY0bU8VHJqt1v0mbhCNBf4rdZfeWfjXhCacxJy3gJLAeyISrZj6KgEBJcYOUnsfpqftO7eOG-Kcd3Ch_nrSDDFmeYpZGrSc/s1600/register-button.jpg"></a>
<br />
Abstract:<br />
There are many ways to write a SQL statement that may lead to the functionally correct answer. However, we often get stuck in a rut using the same SQL syntax over and over even when there may be a better way to write the SQL to enhance performance.
Some techniques worked great in previous Oracle versions but changes in the optimizer with the later versions made the behavior of those techniques change and, in many cases, regress.<br />
<br />
This session covers a number of common anti-patterns that can be rewritten to provide enhanced performance and will help you learn how to:<br />
<br />
<ul>
<li>Recognize certain patterns that can be sub-optimal. </li>
<li>Analyze the "performance footprint" of certain patterns. </li>
<li>Rewrite the anti-patterns to use less resources and take less time to execute. </li>
</ul>
<br />
<br />
I look forward to "seeing" you there!
Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-13277579734636353072014-03-18T14:25:00.001-04:002014-04-16T11:17:01.094-04:00Effective Indexing WebinarThanks to everyone for attending today's Effective Indexing webinar sponsored by IOUG with Embarcadero. For attendees, IOUG will likely send out a link to the recording and PDF of the presentation, but I also wanted to post it here.<br />
<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/2014-03-18-Effective-Indexing.pdf">Presentation PDF</a><br />
<a href="http://youtu.be/9grbFw-XWj0" target="_blank">Webinar recording</a> <br />
<br />
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/9grbFw-XWj0?feature=player_detailpage" width="640"></iframe>
<br />
<br />
Please note that during the webinar I mentioned the new clustering factor calculation available in 12c and also available in some patchsets for 11g releases. The patch number I referred to is incorrect. Instead, please search for the Bug/Enhancement article in MOS. You can find it by searching for "Bug 13262857 - Enh: provide some control over DBMS_STATS index clustering factor computation (Doc ID 13262857.8)."
<br /><br />
Thanks again and stay tuned for additional webinars coming soon!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com2tag:blogger.com,1999:blog-518481768015386858.post-90631694690976414312013-11-17T11:19:00.001-05:002014-03-18T15:29:34.905-04:00Webinar Follow-up: Everyday Oracle ProThanks to everyone who attended the November 12 webinar! <br />
<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/2013-11-12-Everyday-Oracle-Pro.pdf" target="_blank">Presentation PDF</a><br />
<a href="http://www.youtube.com/watch?feature=player_detailpage&v=g6klmTHCU_I" target="_blank">Webinar recording</a> <br />
<br />
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/g6klmTHCU_I?feature=player_detailpage" width="640"></iframe>
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com1tag:blogger.com,1999:blog-518481768015386858.post-28722775552213220092013-10-30T11:15:00.001-04:002013-10-30T14:31:21.489-04:00Becoming an Everyday Oracle Pro - November 12 Webinar<a href="http://bit.ly/1bD62uq" target="_blank">Register for my next webinar</a> on November 12 entitled "Becoming an Everyday Oracle Pro".<br />
<br />
<b>About the webinar</b><br />
Whether you are new to Oracle or a seasoned veteran, you want to do your job to the best of your ability. Each one of us can become an everyday Oracle pro if we strive towards one basic truth: doing something well isn't only about what you know, but about how you apply what you know. Even if you have memorized a lot of information, it's not much good if you can't apply it, and more importantly, understand how and when to apply that knowledge effectively.<br />
<br />
You can become an everyday Oracle pro and make even greater contributions to the success and effectiveness of your organization by focusing on a few basic principles.<br />
<br />
In this session, you will learn:<br />
<br />
<ul>
<li>The 3 R's of being an everyday Oracle Pro (Research, Remember, Replicate)</li>
<li>The difference between memorization and knowledge</li>
<li>How to think clearly about problem solving</li>
<li>How to collect and grow your personal collection of helpful tools</li>
</ul>
<br />
<br />
<br />
This will be the sixth, and final, Embarcadero sponsored webinar for 2013. See you then!<br />
<br />
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-69394708042715997622013-09-20T08:42:00.000-04:002013-10-08T15:27:01.097-04:00Webinar Follow-up: Execution Plans - Learn by ExampleThanks to everyone who attended the September 17 webinar! <br />
<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/2013-09-17-Exec-Plans-by-Example.pdf" target="_blank">Presentation PDF</a><br />
<a href="http://www.youtube.com/watch?feature=player_detailpage&v=OZ_jP-rpyy0" target="_blank">Webinar recording</a> <br />
<br />
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/OZ_jP-rpyy0?feature=player_detailpage" width="640"></iframe>
<br />
<br />
<b>Q&A</b><br />
Q: Do all these methods of showing execution plans work (dbms_sqltune, dbms_xplan) with Oracle Standard Edition? What about creating extended statistics in Oracle SE? Do all these tips work with SE? Is SQL Monitor a licensed product?<br /><br />A: You cannot use SQL Monitor reports (dbms_sqltune) with Oracle Standard Edition as they are produced using elements included in the Tuning Pack license which is *not* available on SE. However, you can use dbms_xplan without restriction and all the tips for how to read and analyze plans are the same regardless of the method you use to display plan data.<br /><br />Q: We have a big table with 80 partitions.. for analyze it is taking long time.. is there any easy way analyze can done quickly?<br /><br />A: You could consider using incremental partition statistics if many of the partitions have data that changes infrequently. Generally speaking, make sure to use the default collection parameters (like estimate_percent=>auto_sample_size) and only collect stats when you really need to (after data changes by > 10%). The following two links to the Optimizer Development Team's blog may also be of some help:<br />https://blogs.oracle.com/optimizer/entry/maintaining_statistics_on_large_partitioned_tables<br />https://blogs.oracle.com/optimizer/entry/incremental_statistics_maintenance_what_statistics<br /><br />Q: How can the order of filters, joins, etc in the where clause be controlled to manually keep a minimum dataset through the execution or just force a different one for educational / what if purposes?<br /><br />A: You can control plan operations and the order in which they are executed using hints. Simply inject the hints that specify access operations (FULL, INDEX) and join methods (USE_HASH, USE_NL) and join order (LEADING). The more hints you provide, the more control you can apply to the plan operations.<br /><br />Q: How do we know if the current execution plan is the best plan or if there is ANY execution plan better than the current execution plan?<br /><br />A: Test! Remember that the optimizer has gone through numerous alternatives before settling in on the final plan. If the plan chosen isn't performing as well as you'd like, then you must try to determine alternatives (by using hints to force some choices or by rewriting the SQL or adjusting statistics...). There is also the Visual SQL Tuning method you could use to "map" the best order of operations for a SQL statement (see my July webinar for more on VST). The bottom-line is that you have to test to understand the performance of the chosen plan and then find the reasons why it under-performs and correct those root causes.<br /><br />Q: Basically the SQL execution is in the AWR SQL history but not in shared pool. and we would like to see the execution plan using dbms_xplan. how can we do that?<br /><br />A: DBMS_XPLAN.DISPLAY_AWR will do the trick. You'll provide the SQL_ID and PLAN_HASH_VALUE (optionally) and the FORMAT parameters you desire.<br /><br />Q: is there a way to force FAST FULL INDEX SCAN instead of INDEX FULL SCAN?<br /><br />A: Hints. The INDEX_FFS (table index) hint would force an INDEX FAST FULL SCAN. Don't use the hint indiscriminately as if the optimizer "thinks" the fast full scan would be better it would have costed it as such and selected that operation. If you believe you should be getting a fast full scan and are not, try and verify why before you hint the SQL.<br /><br />Q: When will optimizer choose INDEX FAST FULL SCAN over INDEX FULL SCAN?<br /><br />A: A fast full scan is similar to a full table scan in that it will read all the blocks (using multiblock reads) in the index without maintaining order. You often see this operation when the query result set can be satisfied from the index contents alone without having to do additional data block accesses. The bottom line (and somewhat cheeky response) is that it will be chosen when the optimizer thinks it is the best choice. If you find otherwise, it's going to be up to you to research and test to discover why the optimizer thought it was best when it actually wasn't.<br /><br />Q: Is there a way to display the lines of execution plan by the order in which the lines are executed, instead of using the indentation which can be VERY tideous for 100+ lines of SQL statement?<br /><br />A: My favorite script for doing this from Randolf Geist and you can find it on his blog at http://oracle-randolf.blogspot.com/2011/12/extended-displaycursor-with-rowsource.html. Of course, you could write your own but no need to reinvent the wheel.<br /><br />Q: In SQL monitor report what do the columns Time Active (s) and start active (S) mean. I never found a good documentation explaining these 2? <br /><br />A: The Time Active(s) column shows how long the operation has been active (the delta in seconds between the first and the last active time). The<br />Start Active column shows, in seconds, when the operation in the execution plan started relative to the SQL statement execution start time. <br /><br />Q: Can you please tell in which case FULL TABLE SCAN is OK to see in the Explain Plan? or IS Full Table Scan is always bad?<br /><br />A: All operations have a good use case! It's critical to **NOT** assign a "good" or "bad" judgment to any of them. Each operation may be optimal given the context in which it is used. With full table scans, you typically hope to see them being used when a significant amount of data from an object is needed (as determined by the number of blocks that must be accessed in order to retrieve the needed rows).<br /><br />Q: What are the trade-offs between SQL Tuning Advisor and Execution Plans?<br /><br />A: I wouldn't say there are any "trade-offs". SQL Tuning Advisor can be used to identify possible changes that could be helpful to your query's performance. One of the options STA may offer is the option to create a SQL Profile. The Profile provides some additional statistical information to the optimizer so it can/should produce a more effective execution plan. I personally think of STA as a tool to point me towards things I need to investigate.<br /><br />Q: When running an execution plan, I see "- dynamic sampling used for this statement (level=6)" even though all of the objects in the query (table and indexes) have good statistics and optimizer_dynamic_sampling=2. Is there a way (without setting a 10053 trace) to find out why dynamic sampling was used, and at what part of the plan it was used?<br /><br />A: From Oracle Database 11g Release 2 onwards the optimizer will automatically decide if dynamic sampling will be useful and what dynamic sampling level will be used for SQL statements executed in parallel. This decision is based on size of the tables in the statement and the complexity of the predicates. However, if the optimizer_dynamic_sampling parameter is explicitly set to a non-default value, then that specified value will be honored. When it does kick in at level 6, it is simply doing a 256 block sample to help the optimizer produce more accurate cardinality estimates on the objects being accessed in parallel.<br /><br />Q: How do you find out about your extended stats, what query or view do I need?<br /><br />A: I'm going to point you to a couple of blog articles from the Optimizer Development Team regarding extended stats which should answer this and any other questions you may have on extended stats.<br />https://blogs.oracle.com/optimizer/entry/extended_statistics<br />https://blogs.oracle.com/optimizer/entry/how_do_i_know_what_extended_statistics_are_needed_for_a_given_workload<br /><br />Q: Does extended stats get maintained automatically or does it need to be manually collected again and again.<br /><br />A: Please see the two links I provided for the previous question for more details. But, generally speaking, once you create an extended statistic, it will continue to be collected (if you use default collection parameters) until you specifically drop the extended stat.<br /><br />Q: How to effectively trace an execution plan for a given SQL to understand why the Optimizer chose the specific execution plan?<br /><br />A: You can capture a 10053 optimizer trace of the given SQL and review the trace file. However, that is not something I'd recommend as a primary method! You can "always" know that the optimizer chose a particular set of plan operations because those operations were the lowest costed options considered by the optimizer. So, if you really want to know why, you need to inspect the inputs the optimizer used to cost the various plans. The place to start is with object statistics and the execution plan rowsource statistics. You need to compare estimated cardinalities with the actual rows returned and find where discrepancies exist. When found, the discrepancies will lead you to the statistics you need to review or they can help you see where/how in the SQL the objects that have discrepancies are used. The bottom-line is that it's going to require you to research and evaluate the plan execution data to determine where the optimizer may have gone astray. Only in very rare cases would I resort to a 10053 trace.<br /><br />Q: If the E-ROWS and A-ROWS differ a lot but still the execution plan did not change in comparing when E-rows and A-rows are matching, will there is a performance difference in the SQL?<br /><br />A: You can't know that unless you find out why the estimates and actuals are different and take the necessary steps to correct things so that the difference is limited or eliminated. Once you find out why there was a difference and correct it, the plan may change and performance may improve. However, depending on the access paths and join methods available to the optimizer, it is entirely possible that the plan may not change after the estimates are improved and performance would therefore remain the same. <br /><br />Q: How to interpret the COST value/estimate of a given SQL?<br /><br />A: Cost is the value computed by the optimizer that indicates the estimated amount of work (time and resources) required to produce the result set. It is computed based on statistical formulas utilized by the optimizer to assign a value to each viable set of plan operations possible for a given SQL statement. For the most part, cost is not something I focus on as it is a given that the cost of the plan selected by the optimizer was computed to be the lowest of all possible choices. Therefore, if the response time and resource usage for that plan doesn't meet my expectations, my next step is to determine where/how the optimizer "went wrong" in computing the selected option as the best/lowest cost.<br /><br />Q: What is the difference between explain plan and execution plan?<br /><br />A: An EXPLAIN PLAN is simply the proposed plan that the optimizer "might" choose when the query is executed. It is *NOT* a guarantee of the plan that will be used at runtime. The execution plan, on the other hand, is the actual plan that was selected by the optimizer and used to produce the query result set. So, the easiest way to differentiate the two is that EXPLAIN PLAN is the estimate, the execution plan is the actual.<br /><br />Q: How to analyze or find which tables need histograms for the best execution plans depending on bind variable values?<br /><br />A: When you're considering histograms, you're considering skew in your data. So, you're looking for columns that contain skewed data. If you simply collect statistics using the default METHOD_OPT parameter ('FOR ALL COLUMNS SIZE AUTO'), histograms will be collected automatically for you. Now, the collection may not be perfect, so you may need to use your own knowledge of the data to help you define specific columns that need histograms. Also, if you find that for queries that use binds your performance is wildly variable, that may be a red flag to point you towards columns that need histograms as well as being an indicator that you might need to adjust your use of bind variables to use some literals to help the optimizer make the best plan choices.<br /><br />Q: Used Memory - what does (0) means?<br /><br />A: This column displays the sum of the maximum amount of memory that was used in all execution of the specific plan operation. <br /><br />Q: What are advantages using this tool over oracle RAT?<br /><br />A: RAT, or Real Application Testing, is simply a way to do two things: 1) capture and replay executions of application code (SQL) for a representative period of workload and 2) compare the performance (i.e. plan changes and resulting differences in response times and resource usage) of an original workload and the workload after some change(s). The 2nd element (known as SQL Performance Analyzer) helps automate the process of comparing before and after execution plans and can highlight plans that change. The plans that change may change for the good (they improve) or for the bad (they regress). SPA captures the changes and helps you to focus in on the plans that regress so that you can do further work to find and correct the issues. STA simply compares performance and plans for the same SQL_IDs and displays the difference. You could do this yourself manually but SPA provides a separately licensable product to do much of the work for you. However, if you find a problem, you'll likely still have to do some work on your own to determine why the plans changed and how to correct them. So, this is not an "either/or" situation. RAT uses execution plans and simply automates a bit of the legwork for you.<br /><br /><br />
<br />
Stay tuned for details of my November webinar coming soon! <br />
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-29378328389991811592013-09-07T15:19:00.000-04:002013-09-07T15:19:54.251-04:00SQL Tuning Fundamentals: Execution Plans - September 17 Webinar<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0GTNy0ctmE4nOt3YSlqWZEP6ChlR9n0mwFWB_UD0bcWCt2XqJPoCZKkv7emwDQloWnXoHeVRUT0ygW_zCYLfNO46H80209K_dAHILKXlRUJpYtIkoRwa3n48A7UfKiPTQvNKWgOlN4kc/s1600/webinar-banner.jpg.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0GTNy0ctmE4nOt3YSlqWZEP6ChlR9n0mwFWB_UD0bcWCt2XqJPoCZKkv7emwDQloWnXoHeVRUT0ygW_zCYLfNO46H80209K_dAHILKXlRUJpYtIkoRwa3n48A7UfKiPTQvNKWgOlN4kc/s1600/webinar-banner.jpg.jpg" /></a></div>
<br />
<a href="http://forms.embarcadero.com/SQLFundamentals_executionplans_KarenMorton?cid=701G0000000XKKG" target="_blank">Register now</a> and join me for my next webinar entitled "SQL Tuning Fundamentals: Execution Plans".<br />
<br />
Few tools are as critical to SQL optimization as the execution plan. The ability to read and understand an execution plan allows us to evaluate and optimize SQL performance. Unfortunately, complex plans often seem daunting and can be difficult to understand.
During this webinar, I'll walk you through a set of guidelines for how to read an execution plan and how to make sense of the operations and statistics (both estimated and actual) the plan output provides.<br />
<br />
Topics covered in this webinar include:<br />
<ul>
<li>How to read an execution plan, and how various plan operations work </li>
<li>How to use the plan to pinpoint performance problems </li>
<li>Tools to accelerate your analysis of execution plan data</li>
</ul>
Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com4tag:blogger.com,1999:blog-518481768015386858.post-79225849333195791042013-07-24T15:47:00.001-04:002013-07-29T13:55:13.365-04:00My day with the Ohio Oracle Users Group<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfWcLEz38tdBIJw3CFbar94I-pqET1ucqgqn8IaiqSLq19wb31P6j4rQXTDDea77Al4yvH5oN693A-kptpkOr7Rae2-jczJvgdJFyEuMB3j2RpZAVUp01ROP7M0-BVm8492lO0unm_Q-s/s1600/ooug_rlogo1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfWcLEz38tdBIJw3CFbar94I-pqET1ucqgqn8IaiqSLq19wb31P6j4rQXTDDea77Al4yvH5oN693A-kptpkOr7Rae2-jczJvgdJFyEuMB3j2RpZAVUp01ROP7M0-BVm8492lO0unm_Q-s/s1600/ooug_rlogo1.gif" /></a></div>
<br />
Thanks so much to everyone who attended the <a href="http://www.ooug.org/" target="_blank">Ohio Oracle User's Group</a> event with me on July 18. I really enjoyed the opportunity to be there. The group appears to be vibrant and growing and everyone involved made it a top-notch experience (for me at least!).<br />
<br />
My topic for the day was "SQL Stuff You Should Know" and was a mash-up of lots of different bits and pieces of information about SQL Tuning and the Oracle Optimizer. Links to my presentation slides will be made available on the OOUG web site, but I thought I'd also provide them here.<br />
<br />
Downloads:<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/OOUG-SQL-Stuff-You-Should-Know.pdf" target="_blank">Presentation slides</a><br />
<a href="https://dl.dropboxusercontent.com/u/56955046/scripts.zip" target="_blank">Scripts</a><br />
<br />
User groups are a fantastic way to network and have easily accessible and inexpensive opportunities to learn. I'm always happy to be invited to participate in an event and even more happy when I see a thriving community of my Oracle peers! Thanks again OOUG!!
Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com1tag:blogger.com,1999:blog-518481768015386858.post-47200171305970315772013-07-23T12:13:00.000-04:002013-09-07T15:05:06.893-04:00Follow-up: Visual SQL Tuning WebinarThanks to everyone who attended my Visual SQL Tuning webinar. My goal was to keep it simple and show the value of using VST to help you know what execution plans "should" do.<br />
<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/2013-07-23-vst.pdf" target="_blank">Presentation PDF</a><br />
<a href="http://www.youtube.com/watch?feature=player_detailpage&v=U-qOsF4zcCU" target="_blank">Webinar recording</a> <br />
<br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/U-qOsF4zcCU?feature=player_detailpage" frameborder="0" allowfullscreen></iframe>
<br />
I want to thank:<br />
Kyle Hailey for his extensive work on the subject and his recent <a href="http://www.slideshare.net/khailey/kscope-2013-vst" target="_blank">great detailed VST presentation from KScope13</a>. <br />
Craig Martin for his building join order diagram I used but incorrectly attributed authorship to Kyle (sorry Craig!).<br />
<br />
I hope to see everyone in September for my next webinar! Stay tuned for details. <br />
<br />
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-64777273029779759922013-07-02T15:57:00.002-04:002013-07-02T15:57:54.505-04:00Visual SQL Tuning - July 23 Webinar<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv_78ILniHHhmvW8wT3tWNJtz-X58khvDmjKoGpqxTuuk6tf2WrqP1InuAtICXIS1-wGJWhcVQ31PXNr51st4mt25J2qheJ2dDcnLf51HzWCgB0_Vd5F17T52pAHs8YyIL4qPCxL4KZRc/s680/KarenMorton_Webinar_680x150_RegNow.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv_78ILniHHhmvW8wT3tWNJtz-X58khvDmjKoGpqxTuuk6tf2WrqP1InuAtICXIS1-wGJWhcVQ31PXNr51st4mt25J2qheJ2dDcnLf51HzWCgB0_Vd5F17T52pAHs8YyIL4qPCxL4KZRc/s1600/KarenMorton_Webinar_680x150_RegNow.jpg" /></a></div>
<br />
<a href="http://bit.ly/129e5tn" target="_blank">Register now</a> and join me on July 23 to discover how Visual SQL Tuning can help you understand execution plans and diagnose performance problems.
During the webinar I'll cover:<br />
<ul>
<li>Visual SQL Tuning basics and how to create a VST diagram </li>
<li>How to evaluate execution plan effectiveness with Visual SQL Tuning diagrams </li>
<li>How to identify problems with performance statistics, SQL syntax, etc. </li>
<li>Tools to accelerate the use of Visual SQL Tuning</li>
</ul>
Hope you'll join me! <br />
Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com3tag:blogger.com,1999:blog-518481768015386858.post-88693374077756095332013-05-14T11:05:00.001-04:002013-06-04T14:07:50.341-04:00Follow-up: Using Optimizer Hints for Oracle Performance Tuning WebinarThanks to everyone who attended my webinar on using hints for Oracle testing and performance tuning. As usual, it was a great event and I appreciate the comments and questions. <br />
<br />
Downloads:<br />
<a href="https://dl.dropboxusercontent.com/u/56955046/2013-05-14-using-hints-for-testing-and-tuning.pdf" target="_blank">Presentation PDF</a><br />
<a href="https://dl.dropboxusercontent.com/u/56955046/fsxs.sql" target="_blank">Related scripts</a><br />
<a href="http://www.youtube.com/watch?feature=player_detailpage&v=nJilnAfw4ME" target="_blank">Webinar recording</a> <br />
<br />
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/nJilnAfw4ME?feature=player_detailpage" width="640"></iframe>
<br />
I'll be back in the saddle again in July so keep your eyes open for the announcement of that event. Thanks again and hope to see you then!<br />
<br />
<br />
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com4tag:blogger.com,1999:blog-518481768015386858.post-30805078794095145612013-05-06T15:55:00.000-04:002013-05-06T15:55:06.804-04:00Using Optimizer Hints for Oracle Performance Tuning<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDuewYf1LeJgWM45C3TB91TGmdRGajEyRfmfZORwlHVAxAga2tXD6SteSH_hXReQ7d_UgBpwqhQyjF3uQYNnwfgT6fLO61O7VsYs1XyMCegfIeXsOdmkNfQYsGnz8TGtdbJULGyd4eG_c/s1600/2013-05-14-webinar-banner.tiff" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDuewYf1LeJgWM45C3TB91TGmdRGajEyRfmfZORwlHVAxAga2tXD6SteSH_hXReQ7d_UgBpwqhQyjF3uQYNnwfgT6fLO61O7VsYs1XyMCegfIeXsOdmkNfQYsGnz8TGtdbJULGyd4eG_c/s1600/2013-05-14-webinar-banner.tiff" /></a></div>
<br />
My next Embarcadero sponsored webinar will be on May 14 and is entitled Using Optimizer Hints for Oracle Performance Tuning.<br />
<br />
<a href="http://forms.embarcadero.com/forms/Optimizer_Hints?cid=701G0000000X1IL" target="_blank">Register now!</a><br />
<br />
<br />
Hints are excellent database performance tuning tools that direct the Oracle optimizer to
utilize specific operations in SQL execution plans. We often use hints
because the Oracle optimizer doesn’t always come up with the execution
plan we want on its own. When used correctly, hints can help stabilize an execution plan to use the same operations over and over allowing the SQL to perform the way we
desire.<br />
<br />
In this webinar, I'll take a look at using hints specifically for testing. Hints are great, and often overlooked, testing tools.<br />
<br />
<a href="http://forms.embarcadero.com/forms/Optimizer_Hints?cid=701G0000000X1IL" target="_blank">Register</a> for Optimizer Hints for Oracle Performance Tuning webinar to learn:
<br />
<ul>
<li>The basics of using optimizer hints to choose desired plan operations </li>
<li>How to setup and compare tests using different optimizer hints for changes in response time and resource consumption </li>
<li>How to create and maintain an information repository of testing results to be used for problem analysis in the future </li>
<li>Tools for applying and testing a broad range of hints </li>
</ul>
Thanks again to Embarcadero (@DBPowerStudio) for their sponsorship of these webinars.<br />
<br />
I hope to see you there!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0tag:blogger.com,1999:blog-518481768015386858.post-2289731358671480682013-03-26T15:05:00.000-04:002013-06-04T14:09:01.444-04:00Back to the Future AWR Mining Webinar Followup<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDbjSgAZ4IL6oswhr65rYc_0aITL7gSCdxhOpyrtqixRU3cGSRM3oI9voKccek89BN8j_zx3E0Novhye_BPfqONnW14N2AmbZ2WhORE7wldAd2K13xQaw8DKZyWblq615q9MfvYXSi7PI/s1600/ppt-title-slide.tiff" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDbjSgAZ4IL6oswhr65rYc_0aITL7gSCdxhOpyrtqixRU3cGSRM3oI9voKccek89BN8j_zx3E0Novhye_BPfqONnW14N2AmbZ2WhORE7wldAd2K13xQaw8DKZyWblq615q9MfvYXSi7PI/s400/ppt-title-slide.tiff" width="400" /></a></div>
<br />
<br />
Thanks to everyone who attended my webinar and thanks to Embarcadero (<a href="https://twitter.com/dbpowerstudio" target="_blank">@DBPowerStudio</a>) for hosting it. The presentation and scripts can be downloaded from the following links:<br />
<br />
<a href="https://dl.dropbox.com/u/56955046/2013-03-26-Back-to-the-Future.pdf" target="_blank">Presentation</a> (PDF)<br />
<a href="https://dl.dropbox.com/u/56955046/back-to-future-scripts.zip" target="_blank">Scripts</a> (ZIP)<br />
<a href="http://www.youtube.com/watch?v=gghNS-mmQmo&feature=youtu.be&elq=f6fc81bca7664a4db1d7c51513c364ff" target="_blank">Webinar recording</a> <br />
<br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/gghNS-mmQmo?feature=player_detailpage" frameborder="0" allowfullscreen></iframe>
<br />
Stay tuned for my next webinar coming in May!<br />
<br />
<br />Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com1tag:blogger.com,1999:blog-518481768015386858.post-57067431594560571812013-03-12T11:09:00.000-04:002013-03-12T12:25:27.224-04:00Webinar - Back to the Future: Oracle SQL Performance Firefighting using AWR<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmQ9DBn9s63surusLnCrQPPm48-DFVammkbnq2MhcKA1hLhOYILWJyksUbA5YuAAiUgjtckEVDIEzmBHnzu7AYxoIvNsuFKHtkgfXG1Z2_8v2jkTQDFbrgSzKCO4rKZ0OE2J8zDfJX2kU/s1600/SQL-using-AWR_Webinar_Morton_680x150.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="139" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmQ9DBn9s63surusLnCrQPPm48-DFVammkbnq2MhcKA1hLhOYILWJyksUbA5YuAAiUgjtckEVDIEzmBHnzu7AYxoIvNsuFKHtkgfXG1Z2_8v2jkTQDFbrgSzKCO4rKZ0OE2J8zDfJX2kU/s640/SQL-using-AWR_Webinar_Morton_680x150.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
It's webinar time again! On March 26, Embarcadero will once again provide sponsorship for my webinar entitled "Back to the Future: Mining AWR Data for Oracle SQL Performance".<br />
<br />
Abstract<br />
Most
of us have been in the situation where, for no apparent reason,
performance for key SQL takes a nose-dive after having previously
performed well. So, how do you handle this situation and stabilize
performance back to acceptable levels? One approach is to go back in
time using execution data stored in AWR. In many cases, AWR may contain
what you need to revert your problem SQL to a better performing
alternative.<br />
<br />
<a href="http://embt.co/W2JzDk" target="_blank">Register</a> for the webinar now to learn:<br />
<ul>
<li>
<div style="font-family: Arial; font-size: 12pt; padding-left: 12px;">
How to mine and analyze AWR data to review the SQL's performance over time</div>
</li>
<li><div style="font-family: Arial; font-size: 12pt; padding-left: 12px;">
How to validate that the SQL is using the "good" execution plan</div>
</li>
<li><div style="font-family: Arial; font-size: 12pt; padding-left: 12px;">
Tools to accelerate your analysis of AWR data and SQL code</div>
</li>
</ul>
There are two sessions (one at 10am EDT and one at 2pm EDT). I hope to see you there!Karenhttp://www.blogger.com/profile/03309823327597536648noreply@blogger.com0