<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Xtended Oracle SQL - Latest Comments</title><link xmlns="http://www.w3.org/2005/Atom" rel="http://api.friendfeed.com/2008/03#sup" href="http://disqus.com/sup/all.sup#forumcomments-948efae9" type="application/json"/><link>http://orasql.disqus.com/</link><description></description><atom:link href="http://orasql.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 18 Jun 2013 09:45:30 -0000</lastBuildDate><item><title>Re: Amazing optimization of getting distinct values from the index, and TopN for each of them</title><link>http://orasql.org/2012/09/21/distinct-values-by-index-topn/#comment-934237892</link><description>&lt;p&gt;Ric, it's just index on (a,b)&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br&gt;Sayan M.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Tue, 18 Jun 2013 09:45:30 -0000</pubDate></item><item><title>Re: Amazing optimization of getting distinct values from the index, and TopN for each of them</title><link>http://orasql.org/2012/09/21/distinct-values-by-index-topn/#comment-934221501</link><description>&lt;p&gt;Could you please let us the ddl for creating index IX_XT_TEST_AB ? This is missing here&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ric</dc:creator><pubDate>Tue, 18 Jun 2013 09:25:01 -0000</pubDate></item><item><title>Re: A couple of well-known but often forgotten things for PL/SQL developers</title><link>http://orasql.org/2013/05/28/a-couple-of-well-known-and-often-forgotten-things-for-plsql-developers/#comment-916139901</link><description>&lt;p&gt;Sorry, it was just "copy-paste" mistake, i've fixed it now. &lt;br&gt;"XTENDER" is my schema.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Sat, 01 Jun 2013 14:23:08 -0000</pubDate></item><item><title>Re: A couple of well-known but often forgotten things for PL/SQL developers</title><link>http://orasql.org/2013/05/28/a-couple-of-well-known-and-often-forgotten-things-for-plsql-developers/#comment-916086191</link><description>&lt;p&gt;In point 1. the functions name is "f_no_data_found", and the dbms_output.put_line is calling ndf. what is ndf ? what is XTENDER ?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sk</dc:creator><pubDate>Sat, 01 Jun 2013 13:10:47 -0000</pubDate></item><item><title>Re: How works optimization of loops in PL/SQL in 11g: Part 1. Deterministic functions</title><link>http://orasql.org/2013/03/13/optimization-of-loops-in-plsql-part-1/#comment-897427248</link><description>&lt;p&gt;When i wrote "stops", i mean that the optimization of this loop just ends on this step and goes to next loop, but not breaks optimization at all.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Tue, 14 May 2013 16:06:48 -0000</pubDate></item><item><title>Re: How works optimization of loops in PL/SQL in 11g: Part 1. Deterministic functions</title><link>http://orasql.org/2013/03/13/optimization-of-loops-in-plsql-part-1/#comment-897410406</link><description>&lt;p&gt;Sayan,&lt;/p&gt;

&lt;p&gt;I was thinking about that, but then I'd expect to see "before" 3 times as well because the outer optimization stops in the inner loop. What is the difference then between BEFORE and AFTER in that case?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">GN</dc:creator><pubDate>Tue, 14 May 2013 15:53:56 -0000</pubDate></item><item><title>Re: How works optimization of loops in PL/SQL in 11g: Part 1. Deterministic functions</title><link>http://orasql.org/2013/03/13/optimization-of-loops-in-plsql-part-1/#comment-897392731</link><description>&lt;p&gt;Grigoriy, thanks for positive feedback!&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;br&gt;1) Could you explain why optimization of outer loop was stopped on inner loop?&lt;br&gt;2) If we replace two lines in the inner loop with "null;", why we'd see "after" three times (if we comment out inner loop completely, then we'd see "after" only 1 time)?&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;I think, both questions have the same answer:&lt;br&gt;Such optimization runs by every loop separately. I'm not sure, but it seems like when optimization finds nested loop, it stops and starts optimization of this next loop. So we cannot get unnesting of several multilevel nested loops.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br&gt;Sayan&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Tue, 14 May 2013 15:36:16 -0000</pubDate></item><item><title>Re: How works optimization of loops in PL/SQL in 11g: Part 1. Deterministic functions</title><link>http://orasql.org/2013/03/13/optimization-of-loops-in-plsql-part-1/#comment-896210743</link><description>&lt;p&gt;Nice article! I have some questions though regarding your 1st test case&lt;br&gt;1) Could you explain why  optimization of outer loop was stopped on inner loop?&lt;/p&gt;

&lt;p&gt;2) If we replace two lines in the inner loop with "null;", why we'd see "after" three times (if we comment out inner loop completely, then we'd see "after" only 1 time)?&lt;/p&gt;

&lt;p&gt;Thanks!!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">GN</dc:creator><pubDate>Mon, 13 May 2013 15:20:23 -0000</pubDate></item><item><title>Re: SQL*Plus tips #5: sql_text/sql_fulltext formatting(sql beatifier)</title><link>http://orasql.org/2013/04/29/sql_text-formatting-sql-beatifier/#comment-888470792</link><description>&lt;p&gt;Thanks, Timur!&lt;/p&gt;

&lt;p&gt;BTW, this gave me the idea: we can change title without executing "echo" - look at &lt;a href="http://orasql.org/scripts/title.sql" rel="nofollow"&gt;http://orasql.org/scripts/titl...&lt;/a&gt;&lt;br&gt;So we can run &lt;br&gt;    @title "new title"&lt;/p&gt;

&lt;p&gt;Also it can works fine on windows too if you have installed "ansicon"&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Tue, 07 May 2013 16:14:21 -0000</pubDate></item><item><title>Re: SQL*Plus tips #5: sql_text/sql_fulltext formatting(sql beatifier)</title><link>http://orasql.org/2013/04/29/sql_text-formatting-sql-beatifier/#comment-888030056</link><description>&lt;p&gt;I'm using (a bit modified) Tanel Poder's login.sql available in his TPT scripts library: &lt;a href="http://tech.e2sn.com/oracle-scripts-and-tools" rel="nofollow"&gt;http://tech.e2sn.com/oracle-sc...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Timur Akhmadeev</dc:creator><pubDate>Tue, 07 May 2013 05:26:53 -0000</pubDate></item><item><title>Re: SQL*Plus tips #5: sql_text/sql_fulltext formatting(sql beatifier)</title><link>http://orasql.org/2013/04/29/sql_text-formatting-sql-beatifier/#comment-881497708</link><description>&lt;p&gt;Thanks, Greg!&lt;br&gt;I peeped the idea about showing session data in terminal title in Timur Akhmadeev's screenshots, and did it with glogin.sql and bash function "settitle".&lt;br&gt;Colored prompt is the one from many features of rlwrap. I'l try later to write "just another" post about convenient settings of SQL*Plus.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Wed, 01 May 2013 14:43:01 -0000</pubDate></item><item><title>Re: SQL*Plus tips #5: sql_text/sql_fulltext formatting(sql beatifier)</title><link>http://orasql.org/2013/04/29/sql_text-formatting-sql-beatifier/#comment-881079857</link><description>&lt;p&gt;Great post, I like Your ideas .&lt;br&gt;Question is hod did You acheived session data in terminal title (sid etc.) and red SQL prompt .&lt;br&gt;Regards&lt;br&gt;GregG&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gregg</dc:creator><pubDate>Wed, 01 May 2013 03:06:57 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-859868528</link><description>&lt;p&gt;And return result of recursive execution with specific substition variable. &lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class="javascript"&gt;&lt;br&gt;SQL&amp;gt; ho cat 3.sql&lt;br&gt;prompt 3.sql executing...&lt;br&gt;col result new_val result noprint&lt;br&gt;select 'result#3' result from dual;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;SQL&amp;gt; ho cat 2.sql&lt;br&gt;prompt 2.sql executing...&lt;br&gt;@3.sql&lt;br&gt;prompt result from 3 = &amp;amp;result&lt;br&gt;define result = "&amp;amp;result, result#2"&lt;/p&gt;

&lt;p&gt;SQL&amp;gt; ho cat 1.sql&lt;br&gt;prompt 1.sql executing...&lt;br&gt;@2.sql&lt;br&gt;prompt result from 2 = &amp;amp;result&lt;br&gt;define result = "&amp;amp;result, result#1"&lt;br&gt;prompt result from 1 = &amp;amp;result&lt;/p&gt;

&lt;p&gt;SQL&amp;gt; @1.sql&lt;br&gt;1.sql executing...&lt;br&gt;2.sql executing...&lt;br&gt;3.sql executing...&lt;/p&gt;

&lt;/code&gt;&lt;p&gt;&lt;code class="javascript"&gt;result from 3 = result#3&lt;br&gt;result from 2 = result#3, result#2&lt;br&gt;result from 1 = result#3, result#2, result#1&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Thu, 11 Apr 2013 13:30:50 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-859860389</link><description>&lt;p&gt;For your specific case you can use the method from my script. As you see, the script dynamically (with query from dual) determines to do recursive call or not(calling of "null" script). So you can insert own conditions in the query.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Thu, 11 Apr 2013 13:21:46 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-859855391</link><description>&lt;p&gt;You can comment without registration on this site. I use disqus as comment system, which allows you to sign in with accounts of several most popular social networks or with disqus account.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Thu, 11 Apr 2013 13:16:00 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-859090335</link><description>&lt;p&gt;Also, I signed up / was given a UID with OraSQL ... but it keeps asking me to pick a name to post a comment ... is there some trick to commenting? seems odd.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sumiche</dc:creator><pubDate>Wed, 10 Apr 2013 18:19:25 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-859089040</link><description>&lt;p&gt;What would these scripts get used for?&lt;br&gt;What I tend to need to do is have a function call itself ... and return with a related item ... and in the process of finding that item, it might need to call itself again (but a different choice is called in a case-branch) ... until the lowest natural level is reached, it gets value X, and passes this back thru N levels of recursion to the original caller.&lt;br&gt;I did write a script once, to pull data out of tables in particular formats ... I check off the tables I want, a master script runs, creating one output script per table selected, and then a master script to handle the output set, however many therer are.&lt;br&gt;Whenever we move our development database (we're just about ready to migrate to 11g), we'll run this script, to pull our editing history out of the old Dev DB (10g), and then use sql loader to load it up (the master script creates one SQL loader control file per table, last, it writes a master batch job to run that set of SQL loader control files, all as a BAT file ... I just click on the batch file, and &amp;lt;poof&amp;gt; I've repopulated N tables) (I did this as an exercise to learn how to write dynamic SQL for an unknown number of columns at run time, and then get the DB to do it itself because I was lazy).&lt;br&gt;Ciao,&lt;br&gt;SM&amp;lt;/poof&amp;gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sumiche</dc:creator><pubDate>Wed, 10 Apr 2013 18:17:37 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-858032949</link><description>&lt;p&gt;Btw, thanks for your scripts! They are excellent classbooks for me!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Tue, 09 Apr 2013 18:43:53 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-858020529</link><description>&lt;p&gt;Hi, Tanel. I'm glad that you read this! :) Yep I know about limitation of recursion and it can be solved through "spool"with N calls, but it is not so interesting :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Tue, 09 Apr 2013 18:24:28 -0000</pubDate></item><item><title>Re: SQL*Plus tips #3: Iterators and recursions</title><link>http://orasql.org/2013/04/09/sqlplus-tips-3-iterators-and-recursions/#comment-858012930</link><description>&lt;p&gt;Nice :) Did you also try to go deeper than 20 levels with the recursion? :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tanel Poder</dc:creator><pubDate>Tue, 09 Apr 2013 18:13:27 -0000</pubDate></item><item><title>Re: SQL*Plus tips. #2</title><link>http://orasql.org/2013/04/02/sqlplus-tips-2/#comment-851023299</link><description>&lt;p&gt;Thanks for the flattering feedback, Igor! &lt;br&gt;As i understand, i can't enable disqus integration with &lt;a href="http://wordpress.org" rel="nofollow"&gt;wordpress.org&lt;/a&gt;, because i use standalone wordpress site.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Wed, 03 Apr 2013 14:34:35 -0000</pubDate></item><item><title>Re: SQL*Plus tips. #2</title><link>http://orasql.org/2013/04/02/sqlplus-tips-2/#comment-850517137</link><description>&lt;p&gt;Thanks, Sayan, very useful script!&lt;br&gt;(and pls make login into disqus for WP account :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor Usoltsev</dc:creator><pubDate>Wed, 03 Apr 2013 04:42:05 -0000</pubDate></item><item><title>Re: Unresolved quiz: Avoiding in-list iterator</title><link>http://orasql.org/2013/03/14/unresolved-quiz-avoiding-in-list-iterator/#comment-843209471</link><description>&lt;p&gt;Thanks, for suggestion. The bug is registered now: Bug 16516751 : SUBOPTIMAL EXECUTION PLAN FOR QUERY WITH JOIN AND IN-LIST USING COMPOSITE INDEX&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Tue, 26 Mar 2013 15:39:20 -0000</pubDate></item><item><title>Re: Controlling &amp;#8220;direct path reads&amp;#8221; decision with INDEX_STATS/table_stats</title><link>http://orasql.org/2013/03/07/just-test-of-adaptive-direct-path-reads-with-index_stats/#comment-841956639</link><description>&lt;p&gt;Sorry, Igor, i've re read your question now and understood that you asks not about number of blocks. &lt;br&gt;Tanel Poder explained a little it here: &lt;a href="http://enkitec.tv/2012/05/19/oracle-full-table-scans-direct-path-reads-object-level-checkpoints-ora-8103s/" rel="nofollow"&gt;http://enkitec.tv/2012/05/19/o...&lt;/a&gt;&lt;br&gt;In 11.2.0.3: &lt;br&gt;1) if number of blocks &amp;lt; _small_table_threshold * 5 - without direct path reads&lt;br&gt;2) if number of blocks &amp;gt; _very_large_object_threshold(in percents)* _db_block_buffers - always with direct path reads&lt;br&gt;3) between "_small_table_threshold * 5" and "_very_large_object_threshold(in percents)* _db_block_buffers" - it depends on blocks number of this object in buffer cache and buffer cache "usage"(tests with buffer cache flushing and, on the contrary, with excessive buffer cache usage with blocks of other objects shows that direct path reads decision also depends on that)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Mon, 25 Mar 2013 15:43:16 -0000</pubDate></item><item><title>Re: Controlling &amp;#8220;direct path reads&amp;#8221; decision with INDEX_STATS/table_stats</title><link>http://orasql.org/2013/03/07/just-test-of-adaptive-direct-path-reads-with-index_stats/#comment-832982708</link><description>&lt;p&gt;Hi, Igor,&lt;/p&gt;

&lt;p&gt;great question! In fact there was:&lt;br&gt;1 run - 10000 blocks&lt;br&gt;2 run - 49525 blocks&lt;br&gt;3 run - 1981 blocks&lt;/p&gt;

&lt;p&gt;But this test not so obvious, so i made new: &lt;a href="http://orasql.org/2013/03/18/example-of-controlling-direct-path-reads-decision-through-sql-profile-hints/" rel="nofollow"&gt;http://orasql.org/2013/03/18/e...&lt;/a&gt;&lt;br&gt;And it looks like _small_table_threshold does not affect to direct path reads on IFFS.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sayan Malakshinov</dc:creator><pubDate>Sun, 17 Mar 2013 19:44:02 -0000</pubDate></item></channel></rss>