{"id":44,"date":"2004-11-19T13:42:26","date_gmt":"2004-11-19T20:42:26","guid":{"rendered":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/?p=44"},"modified":"2004-11-19T13:42:26","modified_gmt":"2004-11-19T20:42:26","slug":"50k-sql-statements-for-100-rows-of-data","status":"publish","type":"post","link":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/2004\/11\/19\/50k-sql-statements-for-100-rows-of-data\/","title":{"rendered":"50K SQL Statements for 100 rows of data"},"content":{"rendered":"<p>Unlike a great deal of Oracle professionals I started my career building Software using OO methodologies and Java.  I approach the Oracle world with an application developer paradigm, and have had to unlearn certain OO precepts.  Mostly I&#8217;ve had to concede that in practical development of technology solutions (greatest benefit, least cost, highest ROI) that the persistence layer can not be a big dumb chalkboard exclusively.  Perhaps some of my Java colleagues may disagree but there are significant cost, implementation, and maintenance advantages to leveraging the power of a full featured RDBMS.<\/p>\n<p>As I was reading <a href=\"http:\/\/www.rittman.net\/home.html\">Mark Rittman&#8217;s<\/a> article on his <a href=\"http:\/\/www.rittman.net\/archives\/001129.html\">Performance Tuning Excursion<\/a> I was reminded of a SWAT task I was given working with the DBA group at an online retailer.  The data access patterns of OO, their OO-Relational mapping components, etc can sometimes be downright counterproductive towards building a sound technology solution.  I was working with an original implementation of this and witnessed a seldom used feature end up nearly bringing the entire site to it&#8217;s knees.  The page received a brand name, and was meant to display the products and their respective primary categories.  The result sets would range from 1 to about 100 products.  I witnessed a similar behavior to what Mark describes in that the persistence layer was querying thousands of times for smaller atomic units to build the composite objects on the application server.  I&#8217;ll leave it to the reader to delve into Mark&#8217;s thorough explanation&#8230;<\/p>\n<p>Consider using the <a href=\"http:\/\/www.rittman.net\/work_stuff\/extended_sql_trace_and_tkprof.htm\">extended SQL trace<\/a> instructions from Mark or further consider <a href=\"\/bt\/blog\/archives\/2004\/10\/whats_that_java.php\">p6spy<\/a> if you don&#8217;t have access to Oracle (and it&#8217;s a Java application of course).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unlike a great deal of Oracle professionals I started my career building Software using OO methodologies and Java. I approach the Oracle world with an application developer paradigm, and have had to unlearn certain OO precepts. Mostly I&#8217;ve had to concede that in practical development of technology solutions (greatest benefit, least cost, highest ROI) that [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/posts\/44"}],"collection":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":0,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}