<?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: Help to optimize select stament in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562336#M1564515</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eduardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally in case which you start with a wildcard the optimizer ignore the index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I borrow from an external page two options for you.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.dba-oracle.com/t_sql_like_clause_index_usage.htm" target="test_blank"&gt;http://www.dba-oracle.com/t_sql_like_clause_index_usage.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try the option to force your LIFEX field index to take advantage of full scan at index level which should be faster than a table full scan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But even if this works for your case you should change the application to check if you really need force the index or not, in other words, only force LIFEX index for case with pattern start with *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ros&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;Additional experts opnion:&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="thread" id="1331471"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Fernando Ros on Jan 6, 2011 11:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jan 2011 22:03:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-01-06T22:03:39Z</dc:date>
    <item>
      <title>Help to optimize select stament</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562331#M1564510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table LIKP we have the field LIFEX and we storage data is this field as you can see in the below examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               LIFEX&lt;/P&gt;&lt;P&gt;123456789       65478947&lt;/P&gt;&lt;P&gt;235689777       54899999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two values separated by sapces, the issue is, users can search using only one of the values, therefore I have to build a select stament that has wildcards in the where condition, something like this: where lifex like '* value*".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you know table likp can have millions of records so the search is too slow. If I only put the wildcard at the end of the value ('value*') it works fine, but if I put the wildcar at begin is also too slow, I think because the index is not used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas about how to build this search (select statment)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eduardo Campos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 16:08:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562331#M1564510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help to optimize select stament</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562332#M1564511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what exactly is the search pattern?&lt;/P&gt;&lt;P&gt;- 10 digits being either the "right" or the "left" on field LIFEX (That would be good)&lt;/P&gt;&lt;P&gt;- or i.e. any 3-7 digits from either "right" or "left" at any position?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you need to stay OPEN SQL (i.e. for coding guideline reasons) or can you use native sql as well?&lt;/P&gt;&lt;P&gt;What is your DB type?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 17:11:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562332#M1564511</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-01-06T17:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help to optimize select stament</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562333#M1564512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it a heavily used field in searches or report driven selections for your company?  Why not index the individual (split) values in a Z-table by delivery number via user exit?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 17:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562333#M1564512</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-01-06T17:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help to optimize select stament</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562334#M1564513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Volker,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The values don´t have a pattern,  sometimes they contain 8 or more digits any of them, but always separated by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our DB is oracle, we can execute open SQL from de ABAP code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eduardo Campos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 19:47:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562334#M1564513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T19:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help to optimize select stament</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562335#M1564514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We cannot split the values, I mean is possible but we have to change several programs and applications that use  table, so in this momment separete the values is not an option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eduardo Campos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 19:50:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562335#M1564514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T19:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help to optimize select stament</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562336#M1564515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eduardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally in case which you start with a wildcard the optimizer ignore the index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I borrow from an external page two options for you.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.dba-oracle.com/t_sql_like_clause_index_usage.htm" target="test_blank"&gt;http://www.dba-oracle.com/t_sql_like_clause_index_usage.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try the option to force your LIFEX field index to take advantage of full scan at index level which should be faster than a table full scan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But even if this works for your case you should change the application to check if you really need force the index or not, in other words, only force LIFEX index for case with pattern start with *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ros&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;Additional experts opnion:&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="thread" id="1331471"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Fernando Ros on Jan 6, 2011 11:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 22:03:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-optimize-select-stament/m-p/7562336#M1564515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T22:03:39Z</dc:date>
    </item>
  </channel>
</rss>

