<?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: What is more efficient in queries in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753074#M784340</link>
    <description>What you don't want to do is go into SQLPLUS for every site if there are more than a dozen or so lookups as suggested by your prior questions:&lt;BR /&gt;Topic 1009299 - Update field based on flat file &lt;BR /&gt;Topic 1009045 - select script returns no results&lt;BR /&gt;&lt;BR /&gt;Those same question suggest to me that you want to perform relational like operations on your data: select where...&lt;BR /&gt;many an 'exists' and so on.&lt;BR /&gt;So I would lean towards making the outside file available in Oracle and have oracle do what oracle does best: join data from tables.&lt;BR /&gt;You could either &lt;BR /&gt;- write a (perl) script to generate SQL inserts in a (temp) table&lt;BR /&gt;- write a simple SQL-loader script for your flat file&lt;BR /&gt;- have Oracle use the 'new fangled' define table on external file (my favorite for this excercise)&lt;BR /&gt;&lt;BR /&gt;Now if you are more of a Unix/Shell/Perl person than an SQL hacker (and I have the impression you are) AND the database data is 'manageable' outside the DB (less than 100,000 rows?) then I'd be temped to just suck all relevant data out of Oracle with a single select and then use a (perl) script to massage the data just so.&lt;BR /&gt;&lt;BR /&gt;The ultimate deciding factor for me would be where the result should be. If the desired result is new or updated data in the database, then go there and stay there. If the target is a (flat)file or list to be mailed or printed, then it is tempting to stay on the Unix side.&lt;BR /&gt;&lt;BR /&gt;Hope this helps deciding,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Thu, 16 Mar 2006 18:36:25 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2006-03-16T18:36:25Z</dc:date>
    <item>
      <title>What is more efficient in queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753072#M784338</link>
      <description>I am trying to understand what would be more efficient.&lt;BR /&gt;We have a flat file that will contain any where up to 400 + sites. ( I am taking very high estimate)(Probably unlikely, more like 150+)&lt;BR /&gt;Do I take each site and query the db to see if it exists in the site table of about 400+, if it does do nothing, if not enter into database. Or, pull the table (select site_id) into a perl array and do a compare, and have perl do all the manipulations then add site_id, if it does not exist.&lt;BR /&gt;&lt;BR /&gt;Any stats, some hard evidence...</description>
      <pubDate>Thu, 16 Mar 2006 17:40:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753072#M784338</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2006-03-16T17:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: What is more efficient in queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753073#M784339</link>
      <description>Either way you could "time" your options to see which one would consume less system resources.&lt;BR /&gt;&lt;BR /&gt;Another option would be load the flat file into a temporary table and compare within the database itself. Intuitively, with this approach you would be comparing only 400+ records as opposed to dumping an entire table (don't know how may records are there in it but if it's &amp;gt;1000; then performance penalty would be there) into a flat file and then using perl to diff out the non-matching records.&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Thu, 16 Mar 2006 18:12:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753073#M784339</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-03-16T18:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: What is more efficient in queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753074#M784340</link>
      <description>What you don't want to do is go into SQLPLUS for every site if there are more than a dozen or so lookups as suggested by your prior questions:&lt;BR /&gt;Topic 1009299 - Update field based on flat file &lt;BR /&gt;Topic 1009045 - select script returns no results&lt;BR /&gt;&lt;BR /&gt;Those same question suggest to me that you want to perform relational like operations on your data: select where...&lt;BR /&gt;many an 'exists' and so on.&lt;BR /&gt;So I would lean towards making the outside file available in Oracle and have oracle do what oracle does best: join data from tables.&lt;BR /&gt;You could either &lt;BR /&gt;- write a (perl) script to generate SQL inserts in a (temp) table&lt;BR /&gt;- write a simple SQL-loader script for your flat file&lt;BR /&gt;- have Oracle use the 'new fangled' define table on external file (my favorite for this excercise)&lt;BR /&gt;&lt;BR /&gt;Now if you are more of a Unix/Shell/Perl person than an SQL hacker (and I have the impression you are) AND the database data is 'manageable' outside the DB (less than 100,000 rows?) then I'd be temped to just suck all relevant data out of Oracle with a single select and then use a (perl) script to massage the data just so.&lt;BR /&gt;&lt;BR /&gt;The ultimate deciding factor for me would be where the result should be. If the desired result is new or updated data in the database, then go there and stay there. If the target is a (flat)file or list to be mailed or printed, then it is tempting to stay on the Unix side.&lt;BR /&gt;&lt;BR /&gt;Hope this helps deciding,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Mar 2006 18:36:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753074#M784340</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-03-16T18:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: What is more efficient in queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753075#M784341</link>
      <description>In my experience, any interpreted language (perl, java, etc.) is quite a bit slower than most of the other options.  You will have to read from the file and the database to compare no matter how you do it.&lt;BR /&gt;&lt;BR /&gt;Personally, I would create a temporary table in the DB to dump the file into, and then do the comparisons and adds inside the DB.&lt;BR /&gt;&lt;BR /&gt;Josh</description>
      <pubDate>Thu, 16 Mar 2006 19:17:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753075#M784341</guid>
      <dc:creator>Joshua Scott</dc:creator>
      <dc:date>2006-03-16T19:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: What is more efficient in queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753076#M784342</link>
      <description>Hi LHradowy,&lt;BR /&gt;&lt;BR /&gt;If have a flat file then write a script to read each line in the flat file and you will query the table to see if the record exists and insert into the table if does not exist.&lt;BR /&gt;&lt;BR /&gt;The other way would be to extract the table  site-id into a flat file and compare this flat file with the flat file data you got and output o a third file the complete list of site id's. Then use SQL Loader (sqlldr) to load the new file data into the table. &lt;BR /&gt;&lt;BR /&gt;In my opinion the second option will be faster. As  you will be comparing two files at the OS level unlike the first option you will read the file content and query the table for a match. And  SQL LOADER is must faster than inserting each row after comparing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Indira A</description>
      <pubDate>Thu, 16 Mar 2006 22:44:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753076#M784342</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2006-03-16T22:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: What is more efficient in queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753077#M784343</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;if you have oracle 9i and upper, you can also look into external tables.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Fri, 17 Mar 2006 02:45:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-is-more-efficient-in-queries/m-p/3753077#M784343</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-03-17T02:45:33Z</dc:date>
    </item>
  </channel>
</rss>

