<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: improving oracle sql statement in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065698#M904716</link>
    <description>A couple of ideas.&lt;BR /&gt;First, the trivial:&lt;BR /&gt;From SQL*PLus, SET COLSEP "&lt;TAB&gt;" (where &lt;TAB&gt; is the tab character) will delimit columns by tabs rather than spaces, so there is no need for syntax like &lt;BR /&gt;   select a||'&lt;TAB&gt;'||b||...&lt;BR /&gt;&lt;BR /&gt;Second, your query is picking rows based on F4111.ILDCT and F46011.IQUWUM. Are these cols indexed? If the number of distinct values in each is low you should consider a bitmap index.&lt;BR /&gt;&lt;BR /&gt;Other than that, once you've exhausted the explain plan and trace options, I should contact oracle support (assuming you have a contract).&lt;BR /&gt;&lt;BR /&gt;-- Graham&lt;BR /&gt;&lt;BR /&gt;&lt;/TAB&gt;&lt;/TAB&gt;&lt;/TAB&gt;</description>
    <pubDate>Tue, 09 Sep 2003 06:31:13 GMT</pubDate>
    <dc:creator>Graham Cameron_1</dc:creator>
    <dc:date>2003-09-09T06:31:13Z</dc:date>
    <item>
      <title>improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065688#M904706</link>
      <description>I have to create a tab-seperated file to import into Cognos. My sql statement looks something like this, but the performance is terrible - anyone have any suggestions?&lt;BR /&gt;&lt;BR /&gt;select a||'&lt;TAB&gt;'||b||'&lt;TAB&gt;'||c from table where ...;&lt;BR /&gt;&lt;BR /&gt;Since everything is concatinated, I don't believe it takes advantage of indexes or anything. My actual sql is more complex, and had table joins, but that is the general idea.&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;/TAB&gt;&lt;/TAB&gt;</description>
      <pubDate>Mon, 08 Sep 2003 11:09:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065688#M904706</guid>
      <dc:creator>bob hollis</dc:creator>
      <dc:date>2003-09-08T11:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065689#M904707</link>
      <description>Hi,&lt;BR /&gt;the problem is not on the part you pasted, but on the other :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The pasted section only states how output is formatted to the user, but do not affect the way it is retrieved.&lt;BR /&gt;&lt;BR /&gt;For a cross-check issue an explain plan for the statement with and without the pipes, and check any difference.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Question is if:&lt;BR /&gt;- did you created proper index for this query?&lt;BR /&gt;- did you analyzed the table and the indexes?&lt;BR /&gt;- did you use any hint, like parallel, for faster retrieving ?&lt;BR /&gt;&lt;BR /&gt;   Massimo</description>
      <pubDate>Mon, 08 Sep 2003 11:31:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065689#M904707</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-09-08T11:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065690#M904708</link>
      <description>Best way to start troubleshooting this is to analyze the execution plan for the statement with EXPLAIN PLAN.  See the following link for details:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76992/ch13_exp.htm#822" target="_blank"&gt;http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76992/ch13_exp.htm#822&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That will tell you if indexes are being used or not.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Mon, 08 Sep 2003 11:50:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065690#M904708</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2003-09-08T11:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065691#M904709</link>
      <description>ok - here is the explain plan - thanks for the advice on this. You were right, the "||" didn't matter. There IS a function where I change a JD EDWARDS julian date to YYYYMM that is rather complex for the F4111 table.&lt;BR /&gt;Can somebody tell me what all this means?&lt;BR /&gt;&lt;BR /&gt;OPERATIONS                OPTIONS         OBJECT_NAME                           &lt;BR /&gt;------------------------- --------------- -----------------------               &lt;BR /&gt;  NESTED LOOPS                                                                  &lt;BR /&gt;    NESTED LOOPS                                                                &lt;BR /&gt;      NESTED LOOPS                                                              &lt;BR /&gt;        TABLE ACCESS      FULL            F46011                                &lt;BR /&gt;        TABLE ACCESS      BY INDEX ROWID  F4111                                 &lt;BR /&gt;          INDEX           RANGE SCAN      F4111_6                               &lt;BR /&gt;      TABLE ACCESS        BY INDEX ROWID  F4102                                 &lt;BR /&gt;        INDEX             RANGE SCAN      F4102_10                              &lt;BR /&gt;    TABLE ACCESS          BY INDEX ROWID  F4801T                                &lt;BR /&gt;      INDEX               UNIQUE SCAN     F4801T_PK</description>
      <pubDate>Mon, 08 Sep 2003 14:12:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065691#M904709</guid>
      <dc:creator>bob hollis</dc:creator>
      <dc:date>2003-09-08T14:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065692#M904710</link>
      <description>Also - we use CBO with a weekly analysis of all the tables - database is set to "choose"</description>
      <pubDate>Mon, 08 Sep 2003 14:15:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065692#M904710</guid>
      <dc:creator>bob hollis</dc:creator>
      <dc:date>2003-09-08T14:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065693#M904711</link>
      <description>first problem:  TABLE ACCESS FULL F46011 &lt;BR /&gt;&lt;BR /&gt;issue an analyze against this table, or create some appropriate index on that table&lt;BR /&gt;&lt;BR /&gt;how is the analyze computed? compute or estimate statistcs ?&lt;BR /&gt;&lt;BR /&gt;maybe a weekly run is not sufficient, think of half-week run..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The function to calculate the julian date... why don't you create another table, which maintain such conversions always ? We could change from a calculation to a lookup against another table... much faster.&lt;BR /&gt;&lt;BR /&gt;Can you change the query and issue the query as parallel, if you use parallel query server ? Maybe you can think of adding them, just for this purpose.&lt;BR /&gt;&lt;BR /&gt;   Massimo&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Sep 2003 14:37:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065693#M904711</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-09-08T14:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065694#M904712</link>
      <description>What version of Oracle are you running?&lt;BR /&gt;&lt;BR /&gt;The plan is telling you that the indexes for tables F4111, F4102 and F4801T are being used (which is good), but that a full table scan is being done on F46011.  If this is a large table that could explain why the performance is bad.&lt;BR /&gt;&lt;BR /&gt;For extra details, turn on SQL tracing with "ALTER SESSION SET SQL_TRACE=TRUE" before running the query.  Then find your trace file in the UDUMP directory and run tkprof over it (with the explain option to include the explain plan output).  That will show you where all the time is being spent.  &lt;BR /&gt;&lt;BR /&gt;There's not much else I can tell you without understanding your database or the query you're trying to run.  Have a good read of the "designing and tuning for performance" guide (link in my last post - click on contents), there are loads of tips and tricks for optimising performance.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Mon, 08 Sep 2003 14:37:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065694#M904712</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2003-09-08T14:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065695#M904713</link>
      <description>we are currently running the 8.1.6.2 version of oracle.&lt;BR /&gt;i checked and all tables and indexes involved in the query were analyzed yesterday&lt;BR /&gt;the sizes of the individual tables&lt;BR /&gt;f46011   39,508 rows&lt;BR /&gt;f4801t   242,646 rows&lt;BR /&gt;f4102    163,619 rows&lt;BR /&gt;f4111   3,650,629 rows&lt;BR /&gt;&lt;BR /&gt;the actual query&lt;BR /&gt;SELECT &lt;BR /&gt;F4111.ILLITM, &lt;BR /&gt;F4111.ILMCU, &lt;BR /&gt;F4111.ILDCT,&lt;BR /&gt;to_char(to_date(substr(to_char(F4111.ILTRDJ),1,3)+1900||substr(to_char(F4111.ILTRDJ),4,3),'YYYYDDD'),'YYYYMMDD') ,&lt;BR /&gt;F4111.ILTRQT, &lt;BR /&gt;F4111.ILPAID, &lt;BR /&gt;F4102.IBSRP6, &lt;BR /&gt;F4801T.WALINE, &lt;BR /&gt;F46011.IQUOM, &lt;BR /&gt;F46011.IQGWEI, &lt;BR /&gt;F46011.IQUWUM, &lt;BR /&gt;F4111.ILRCD&lt;BR /&gt;FROM JDEDATA.F4111 , JDEDATA.F4102 , JDEDATA.F4801T , JDEDATA.F46011&lt;BR /&gt;WHERE&lt;BR /&gt;F4111.ILLITM = F4102.IBLITM AND&lt;BR /&gt;F4111.ILMCU = F4102.IBMCU AND&lt;BR /&gt;F4111.ILDOCO = F4801T.WADOCO AND&lt;BR /&gt;F4111.ILMCU = F46011.IQMCU AND&lt;BR /&gt;F4111.ILITM = F46011.IQITM AND &lt;BR /&gt;(F4111.ILDCT = 'IC' OR F4111.ILDCT = 'IS') AND&lt;BR /&gt;F46011.IQUWUM = 'KG' AND F46011.IQUOM = 'EA' ;</description>
      <pubDate>Mon, 08 Sep 2003 15:03:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065695#M904713</guid>
      <dc:creator>bob hollis</dc:creator>
      <dc:date>2003-09-08T15:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065696#M904714</link>
      <description>currently the query is taking 8-10 hours to run - our trace files are limited to 5 meg.&lt;BR /&gt;Any advice on setting up a sql trace?</description>
      <pubDate>Mon, 08 Sep 2003 17:03:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065696#M904714</guid>
      <dc:creator>bob hollis</dc:creator>
      <dc:date>2003-09-08T17:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065697#M904715</link>
      <description>Bob,&lt;BR /&gt;&lt;BR /&gt;1. Verify that you have a index on F46011 on IQMCU, IQITM, IQUWUM, and IQUOM.  Preferably, one index on all 4 columns would give the best performance.&lt;BR /&gt;&lt;BR /&gt;2. You can setup a sqltrace from the system by modifying the "sql_trace" parameter in the init.ora, or in the session by issuing "alter session set sql_trace = true".  &lt;BR /&gt;&lt;BR /&gt;Also, in the future, you might not want to issue 8 points to people until the end.  It marks the thread as solved, which leads people to skip it.  Point values of 1-7 will not do this.  Up to you, just my opinion.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Mon, 08 Sep 2003 19:24:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065697#M904715</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-09-08T19:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065698#M904716</link>
      <description>A couple of ideas.&lt;BR /&gt;First, the trivial:&lt;BR /&gt;From SQL*PLus, SET COLSEP "&lt;TAB&gt;" (where &lt;TAB&gt; is the tab character) will delimit columns by tabs rather than spaces, so there is no need for syntax like &lt;BR /&gt;   select a||'&lt;TAB&gt;'||b||...&lt;BR /&gt;&lt;BR /&gt;Second, your query is picking rows based on F4111.ILDCT and F46011.IQUWUM. Are these cols indexed? If the number of distinct values in each is low you should consider a bitmap index.&lt;BR /&gt;&lt;BR /&gt;Other than that, once you've exhausted the explain plan and trace options, I should contact oracle support (assuming you have a contract).&lt;BR /&gt;&lt;BR /&gt;-- Graham&lt;BR /&gt;&lt;BR /&gt;&lt;/TAB&gt;&lt;/TAB&gt;&lt;/TAB&gt;</description>
      <pubDate>Tue, 09 Sep 2003 06:31:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065698#M904716</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-09-09T06:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065699#M904717</link>
      <description>As long as you turn on tracing for your session only and turn it off after the query the resulting trace file should be quite small, even if it takes ages to run.  DONT turn it on in init.ora, that will enable it in all sessions!&lt;BR /&gt;&lt;BR /&gt;Tkprof will give you much more information about where the bulk of the work is being done, then you can focus your tuning efforts there.  As with any performance problem, change one thing at a time and measure with further tracing.  If you can, set up a test system with a proportionally smaller version of the DB.  &lt;BR /&gt;&lt;BR /&gt;A couple of other points / things to try:&lt;BR /&gt;&lt;BR /&gt;* Run the query at a quieter time - if there is loads of DML activity on the queried data performance will be severely hit because Oracle will have to keep pulling blocks out of rollback (and you run the risk of snapshot too old problems).&lt;BR /&gt;&lt;BR /&gt;* Omit the complicated date calculations you're doing, just for comparison sake.&lt;BR /&gt;&lt;BR /&gt;* Try doing some of the queries as temporary views (ie nested select statements in the from clause), especially the query on F4111 as its your largest table.  That has helped me in the past.&lt;BR /&gt;&lt;BR /&gt;* Measure other DB performance indicators such as buffer cache hit ratio while the query is being run - you may need to increase your SGA size.&lt;BR /&gt;&lt;BR /&gt;And try posting to the comp.databases.oracle.server - there are many more SQL experts there!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 09 Sep 2003 07:54:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065699#M904717</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2003-09-09T07:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065700#M904718</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;you should call SQL Trace and TKPROF to the rescue.&lt;BR /&gt;&lt;BR /&gt;For more details see: &lt;A href="http://otn.oracle.com/doc/oracle8i_816/server.816/a76992/ch14_str.htm" target="_blank"&gt;http://otn.oracle.com/doc/oracle8i_816/server.816/a76992/ch14_str.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If possible post your output so that we can have a look.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Tue, 09 Sep 2003 09:09:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065700#M904718</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-09-09T09:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065701#M904719</link>
      <description>here are the results of tkprof&lt;BR /&gt;This one only took 4 hours because I ran it on a test machine that isn't used much - about the same number of records though.&lt;BR /&gt;I did find out the following from looking at the where clause - the *LITM compares char(25)&lt;BR /&gt;and the 2 *MCU compares are char(12) - those might be expensive.&lt;BR /&gt;Any other insights? You guys are great!&lt;BR /&gt;&lt;BR /&gt;SELECT F4111.ILLITM, F4111.ILMCU, F4111.ILDCT,&lt;BR /&gt;        to_char(to_date(substr(to_char(F4111.ILTRDJ),1,3)+1900||substr(to_char(F4111.ILTRDJ),4,3),'YYYYDDD'),'YYYYMMDD') ,&lt;BR /&gt;        F4111.ILTRQT, F4111.ILPAID, F4102.IBSRP6, F4801T.WALINE, F46011.IQUOM, F46011.IQGWEI, F46011.IQUWUM, F4111.ILRCD&lt;BR /&gt;FROM JDEDATA.F4111 , JDEDATA.F4102 , JDEDATA.F4801T , JDEDATA.F46011&lt;BR /&gt;        WHERE&lt;BR /&gt;                F4111.ILLITM = F4102.IBLITM AND&lt;BR /&gt;                F4111.ILMCU = F4102.IBMCU AND&lt;BR /&gt;                F4111.ILDOCO = F4801T.WADOCO AND&lt;BR /&gt;                F4111.ILMCU = F46011.IQMCU AND&lt;BR /&gt;                F4111.ILITM = F46011.IQITM AND (F4111.ILDCT = 'IC' OR F4111.ILDCT = 'IS') AND&lt;BR /&gt;                F46011.IQUWUM = 'KG' AND F46011.IQUOM = 'EA' &lt;BR /&gt;&lt;BR /&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;Parse        1      0.00       0.00          0          0          0           0&lt;BR /&gt;Execute      1      0.00       0.00          0          0          0           0&lt;BR /&gt;Fetch    19827  10914.94   14058.22     253810  865676081          4      297376&lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;total    19829  10914.94   14058.22     253810  865676081          4      297376&lt;BR /&gt;&lt;BR /&gt;Misses in library cache during parse: 0&lt;BR /&gt;Optimizer goal: CHOOSE&lt;BR /&gt;Parsing user id: 5  &lt;BR /&gt;&lt;BR /&gt;Rows     Row Source Operation&lt;BR /&gt;-------  ---------------------------------------------------&lt;BR /&gt; 297376  NESTED LOOPS &lt;BR /&gt; 325541   NESTED LOOPS &lt;BR /&gt; 325541    NESTED LOOPS &lt;BR /&gt;  31661     TABLE ACCESS FULL F46011 &lt;BR /&gt; 357200     TABLE ACCESS BY INDEX ROWID F4111 &lt;BR /&gt;1312360      INDEX RANGE SCAN (object id 10281)&lt;BR /&gt; 651080    TABLE ACCESS BY INDEX ROWID F4102 &lt;BR /&gt;1901694724     INDEX RANGE SCAN (object id 7132)&lt;BR /&gt; 297376   TABLE ACCESS BY INDEX ROWID F4801T &lt;BR /&gt; 622916    INDEX UNIQUE SCAN (object id 8009)&lt;BR /&gt;&lt;BR /&gt;********************************************************************************&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2003 10:39:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065701#M904719</guid>
      <dc:creator>bob hollis</dc:creator>
      <dc:date>2003-09-09T10:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065702#M904720</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;first of all, it would be of help to know which indexes are defined.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; &lt;BR /&gt;select TABLE_NAME, INDEX_NAME, COLUMN_POSITION, substr(column_name,1,30) &lt;BR /&gt;from DBA_IND_COLUMNS&lt;BR /&gt;where table_name in ( 'F46011','F4801T','F4102','F4111' )&lt;BR /&gt;order by  TABLE_NAME, INDEX_NAME, COLUMN_POSITION ;&lt;BR /&gt;&lt;BR /&gt;Second make sure that all tables and indexes are analyzed if possible with COMPUTE STATISTICS.&lt;BR /&gt;&lt;BR /&gt;Third let's check, how the data is distributed for the indexed columns:&lt;BR /&gt;&lt;BR /&gt;select a.TABLE_NAME, a.COLUMN_NAME, a.num_distinct&lt;BR /&gt; from dba_TAB_COL_STATISTICS a&lt;BR /&gt;where a.table_name in ( 'F46011','F4801T','F4102','F4111' )&lt;BR /&gt; and a.column_name in &lt;BR /&gt;   ( select distinct b.column_name from DBA_IND_COLUMNS b where b.table_name=a.table_name);&lt;BR /&gt;&lt;BR /&gt;From the explain, one would suggest, that the FULL SCAN on F46011 ist the disturbing one (which is most likely) but it does not have to be this one.&lt;BR /&gt;Esp. it would be interesting to know, how many rows you get for&lt;BR /&gt;select count(*) from F46011 where&lt;BR /&gt;F46011.IQUWUM = 'KG' AND F46011.IQUOM = 'EA' ; &lt;BR /&gt;&lt;BR /&gt;If this is significantly small against the 39508 rows, go for a combined index on those two columns and if it does not reduce the access time specify this index via hint on your query.&lt;BR /&gt;&lt;BR /&gt;Good hunting&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 09 Sep 2003 11:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065702#M904720</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2003-09-09T11:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065703#M904721</link>
      <description>&amp;gt; 651080 TABLE ACCESS BY INDEX ROWID F4102 &lt;BR /&gt;&amp;gt; 1901694724 INDEX RANGE SCAN (object id 7132) &lt;BR /&gt;&lt;BR /&gt;Ouch... almost 2 billion rows compared when table F4102 is brought into the join.  &lt;BR /&gt;&lt;BR /&gt;For comparison sake how much faster is the query if you remove F4102 (there's only one selected field from this table)?&lt;BR /&gt;&lt;BR /&gt;What fields on this table are indexed?&lt;BR /&gt;&lt;BR /&gt;I'd really start experimenting on your test system.  Break down the query into smaller chunks and work out exactly where all the work is being done; create the index others have suggested; try to change the join order (with the /* +ORDERED */ hint) so that F4102 is joined in last; try using star queries...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2003 15:07:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065703#M904721</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2003-09-09T15:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065704#M904722</link>
      <description>Steven has a good point.&lt;BR /&gt;This seems extremly expensive, esp. as F4102 has only 160.000 rows !&lt;BR /&gt;&lt;BR /&gt;Since F4111 is the biggest one, I'd like to know in addition how many rows your get on&lt;BR /&gt;&lt;BR /&gt;select count(*) from f4111&lt;BR /&gt;where ILDCT = 'IC';&lt;BR /&gt;&lt;BR /&gt;select count(*) from f4111&lt;BR /&gt;where ILDCT = 'IS';&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 09 Sep 2003 16:50:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065704#M904722</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2003-09-09T16:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065705#M904723</link>
      <description>I added some indexes and got the following plan&lt;BR /&gt;which looks a lot better. I also tried someone's suggestion to make a small table to do the julian conversions via lookup - this turned out to be a very bad idea. I ran this test first and it ran for over 12 hours. It never finished because all the developers were yelling at me that the test system was hardly moving. I'll try it again tonight and use the function. I did find a much simpler version, so we will see.&lt;BR /&gt;Thanks for all your help ??? I???ll tell you what happens tomorrow.&lt;BR /&gt;---&lt;BR /&gt;OPERATIONS                OPTIONS         OBJECT_NAME                           &lt;BR /&gt;------------------------- --------------- -----------------------               &lt;BR /&gt;  NESTED LOOPS                                                                  &lt;BR /&gt;    NESTED LOOPS                                                                &lt;BR /&gt;      NESTED LOOPS                                                              &lt;BR /&gt;        TABLE ACCESS      BY INDEX ROWID  F46011                                &lt;BR /&gt;          INDEX           RANGE SCAN      F46011_V05                            &lt;BR /&gt;        TABLE ACCESS      BY INDEX ROWID  F4111                                 &lt;BR /&gt;          INDEX           RANGE SCAN      F4111_6                               &lt;BR /&gt;      TABLE ACCESS        BY INDEX ROWID  F4102                                 &lt;BR /&gt;        INDEX             RANGE SCAN      F4102_V01                             &lt;BR /&gt;    TABLE ACCESS          BY INDEX ROWID  F4801T                                &lt;BR /&gt;      INDEX               UNIQUE SCAN     F4801T_PK</description>
      <pubDate>Wed, 10 Sep 2003 16:07:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065705#M904723</guid>
      <dc:creator>bob hollis</dc:creator>
      <dc:date>2003-09-10T16:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065706#M904724</link>
      <description>Hi,&lt;BR /&gt;just curious, as you did not tell how many rows your query returns :-)&lt;BR /&gt;&lt;BR /&gt;If this is a whole lot ( +Mios ), there is another one:&lt;BR /&gt;&lt;BR /&gt;Index on F4801T.WADOCO,F4801T.WALINE.&lt;BR /&gt;&lt;BR /&gt;This is not obvious, because the Uniqe scan suggests that this join is good. But as you only need one field from this table (second largest), this index would turn the index uniqe scan and the following table access into a index fast full scan (without table access at all). &lt;BR /&gt;Statisticly this should cut your gets on this table by two. If the average row-length on this table is big it could be even better, because disk reads should go down as well.&lt;BR /&gt;...but only worth in overall number of rows for your query is large !&lt;BR /&gt;&lt;BR /&gt;Good hunting once more&lt;BR /&gt;Volker&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Sep 2003 16:26:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065706#M904724</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2003-09-10T16:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: improving oracle sql statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065707#M904725</link>
      <description>My fault,&lt;BR /&gt;a lookup table seemed to me a good idea, sorry!&lt;BR /&gt;&lt;BR /&gt; In any case,&lt;BR /&gt;glad to see that indexes are working.&lt;BR /&gt;&lt;BR /&gt;Did you also refreshed the statistics ?&lt;BR /&gt;&lt;BR /&gt;   Massimo&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Sep 2003 16:37:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/improving-oracle-sql-statement/m-p/3065707#M904725</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-09-10T16:37:28Z</dc:date>
    </item>
  </channel>
</rss>

