{"id":901,"date":"2005-11-19T12:00:00","date_gmt":"2005-11-19T12:00:00","guid":{"rendered":"http:\/\/orcldoug.com\/blog\/?p=901"},"modified":"2005-11-19T12:00:00","modified_gmt":"2005-11-19T12:00:00","slug":"another-interesting-lewis-tip","status":"publish","type":"post","link":"http:\/\/orcldoug.com\/blog\/2005\/11\/19\/another-interesting-lewis-tip\/","title":{"rendered":"Another Interesting Lewis Tip"},"content":{"rendered":"<p><strong>Updated 24th November 2005<\/strong><br \/><strong><\/strong><br \/><strong>I wouldn&#8217;t normally update an existing entry but there are some very interesting and important comments on this entry, particularly from Jonathan Lewis and Howard Rogers, that I&#8217;d recommend you take the time to read. Jonathan also mentions it <a href=\"http:\/\/www.jlcomp.demon.co.uk\/cbo_book\/ch_05.html\">on his website<\/a>. There&#8217;s much more in the book of course &#128521; My thanks to Howard and Jonathan.<\/strong><br \/><strong><\/strong><br \/>I certainly wouldn&#8217;t want to reproduce the whole of <a href=\"http:\/\/www.jlcomp.demon.co.uk\/cbo_book\/ind_book.html\">Jonathan Lewis&#8217; new book<\/a> in a blog but I think it&#8217;s worth one last posting for a couple of reasons.<\/p>\n<ol>\n<li>I think it&#8217;s a good way to highlight the existence of a <a href=\"http:\/\/www.apress.com\/book\/supplementDownload.html?bID=10081&amp;sID=3080\">free sample chapter<\/a> online as pointed out by <a href=\"http:\/\/dba-blog.blogspot.com\/2005\/11\/simple-chapter-from-cost-based-oracle.html\">Radoslav Rusinov<\/a>. If you haven&#8217;t ordered the book, have a read of that for free and decide if you&#8217;re interested in 13 more chapters of the same quality.<\/li>\n<li>As someone who is predominantly a DBA I&#8217;m very keen on Jonathan pointing out how what might <span style=\"FONT-STYLE: italic\">seem<\/span> a simple DBA action could unwittingly impact an application in unusual ways. However (and this is important) as I&#8217;ve re-read bits of the book I can also think of dozens of ways that a developer could cause problems for the DBA &#128521; In fact, I&#8217;ve started to get a teensy bit worried that I&#8217;m going to have more and more developers rolling up at my desk with &#8216;bright ideas&#8217; because they&#8217;ve read the bits of this book that they want to, conveniently missing the numerous caveats that Jonathan is always careful to include. As long as people take the book as a whole and use some common sense &#8230;<\/li>\n<\/ol>\n<p>Anyway, here&#8217;s the excerpt, which I&#8217;ll consider worth posting if it stops one poor DBA doing this by accident!<\/p>\n<blockquote><p>&#8220;Oracle 10g has introduced a mechanism to compact a table online. This<br \/>only works for a table with row movement enabled that is stored in a tablespace using ASSM.<\/p>\n<p>You might use a sequence of commands like the following to compact a table:<\/p>\n<ul>\n<li>alter table x enable row movement;<\/li>\n<li>alter table x shrink space compact; &#8212; moves rows around<\/li>\n<li>alter table x shrink space; &#8212; drops the high water mark<\/li>\n<\/ul>\n<p>Before you rush into using this feature, just remember that it allows you to reclaim space by filling holes at the start of the table with data moved from the end of the table. In other words, any natural clustering of data based on arrival time could be lost as data is moved one row at a time from one end of the table to the other. Be careful about the effect this could have on the clustering_factor and desirability of the indexes on such a table.&#8221;<\/p><\/blockquote>\n<p>I can see this happening. You think &#8211; &#8216;Cool, look at that nice feature for reclaiming some space. Let&#8217;s use that!&#8217; &#8211; so, you do. A week passes. A Saturday night statistics gathering job kicks in and the clustering factor of several indexes changes to reflect the new distribution of the data. Then, on Monday morning the performance of a couple of queries plummets and no-one can quite work out why. Trust me that it would be a nightmare. This is the way many sites work and this change wouldn&#8217;t be identified as high risk. Let me reiterate &#8211; you change where data is stored and so your application starts to work differently, but only after your statistics have been refreshed so could you tie it to the reorganisation activity? Of course, it might be a sensible behaviour change from the point of view of the optimiser but could you have predicted it? Well, if you buy the book, you&#8217;d at least be aware of the issue.<\/p>\n<p>* I think it&#8217;s worth noting that when I bumped into Jonathan at the UKOUG conference just as the book was being published, he was very pre-occupied by a small error in the book (which funnily enough he&#8217;d introduced himself, having got it right the first time!). If you look at <a href=\"http:\/\/www.jlcomp.demon.co.uk\/cbo_book\/ind_book.html\">this page<\/a> on his website, you&#8217;ll notice how committed he is to correcting the tiniest of errors. That should tell you all you need to know about the quality of his work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Updated 24th November 2005I wouldn&#8217;t normally update an existing entry but there are some very interesting and important comments on this entry, particularly from Jonathan Lewis and Howard Rogers, that I&#8217;d recommend you take the time to read. Jonathan also mentions it on his website. There&#8217;s much more in the book of course &#128521; My&hellip; <a class=\"more-link\" href=\"http:\/\/orcldoug.com\/blog\/2005\/11\/19\/another-interesting-lewis-tip\/\">Continue reading <span class=\"screen-reader-text\">Another Interesting Lewis Tip<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-901","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":882,"url":"http:\/\/orcldoug.com\/blog\/2006\/01\/15\/jonathan-lewis-on-10gr2-sort-efficiency\/","url_meta":{"origin":901,"position":0},"title":"Jonathan Lewis on 10gR2 Sort efficiency","date":"January 15, 2006","format":false,"excerpt":"Just in case you miss it ... Jonathan has an interesting new piece on sort efficiency in 10gR2.What struck me on reading this is that, no matter how mature the CBO may be, small improvements are constant. That tells me that it's a mistake to rely on an optimiser to\u2026","rel":"","context":"With 1 comment","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1334,"url":"http:\/\/orcldoug.com\/blog\/2007\/10\/29\/interesting-seminars-in-the-netherlands\/","url_meta":{"origin":901,"position":1},"title":"Interesting Seminars in the Netherlands","date":"October 29, 2007","format":false,"excerpt":"It's very unlikely that anyone who reads this blog wouldn't have noticed Jonathan Lewis' advert for a couple of interesing seminars coming up in Holland but, just in case. I can't get more time off to go, personally, but give me a shout if you're interested ... (maybe I could\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":850,"url":"http:\/\/orcldoug.com\/blog\/2006\/03\/01\/i-just-drove-to-work-with-jonathan-lewis\/","url_meta":{"origin":901,"position":2},"title":"I just drove to work with Jonathan Lewis","date":"March 1, 2006","format":false,"excerpt":"Prompted by Mark Rittman's blog, I downloaded the interview with Jonathan Lewis from DBAZine. I have an iPod-compatible hi-fi in the car. Once I'd got over the shock of DBAZine displaying in my car and stopped wondering where my life was going, it was a very interesting and forthright interview\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1295,"url":"http:\/\/orcldoug.com\/blog\/2007\/07\/12\/jonathan-lewis-articles\/","url_meta":{"origin":901,"position":3},"title":"Jonathan Lewis Articles","date":"July 12, 2007","format":false,"excerpt":"Some of you will already know this, but ....I pointed out the following entertaining thread on one of the OTN Forums to a friend. He asked how I had noticed it. I'm sorry to disappoint you, but I don't spend all day on the forums (and at this point I\u2026","rel":"","context":"With 4 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1525,"url":"http:\/\/orcldoug.com\/blog\/2009\/10\/12\/oow-2009-the-jonathan-lewis-comedy-hour\/","url_meta":{"origin":901,"position":4},"title":"OOW 2009 &#8211; The Jonathan Lewis Comedy Hour","date":"October 12, 2009","format":false,"excerpt":"Well, it's definitely a cold. Made it to bed just after 1 after a party which had convinced me I was feeling better, only to wake up stuffed with the cold, completely convinced that I'd slept in. It was 4:45 \ud83d\ude41 Bizarrely, I feel fully refreshed sleep-wise, but blocked up\u2026","rel":"","context":"With 2 comments","img":{"alt_text":"","src":"\/serendipity\/uploads\/xoakribbon1.jpg.pagespeed.ic.3zERKY-0YZ.jpg","width":350,"height":200},"classes":[]},{"id":1297,"url":"http:\/\/orcldoug.com\/blog\/2007\/07\/16\/todays-links\/","url_meta":{"origin":901,"position":5},"title":"Today&#8217;s Links","date":"July 16, 2007","format":false,"excerpt":"Here are a few interesting blog postings I've been reading this week.Jonathan Lewis on another Statspack example.Nuno Souto on SQL Server - in three parts. What I particularly like about these postings is that the man has used both and is honest about their relative strengths and weaknesses, rather than\u2026","rel":"","context":"With 3 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts\/901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/comments?post=901"}],"version-history":[{"count":0,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/posts\/901\/revisions"}],"wp:attachment":[{"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/media?parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/categories?post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/orcldoug.com\/blog\/wp-json\/wp\/v2\/tags?post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}