Performance of using a "Like" Filter *is not due to straight index issue*

Hello,
We have just released an Oracle APEX app to the users and ran into a performance issue in the production version that was not in development. The interactive report goes against a simple view that returns Data similar to:
NAME VALUE MIN MAX
BEL123 1 1 3
BEL245 3 3 4
AB222 2 1 3
The issue is that when a filter is used on the name column with a like operand (name LIKE 'BEL%' ). The query performance become very poor (average is 29 seconds to return according to the APEX stats). These are huge tables but the performance in the development area is quick (almost instantaneous). Here are the things I have looked into to try and narrow the problem down:
1) I have tried running the exact same query in SQL*Plus and the performance is quick in both production and development, so its not the indexes.
2) Creating brand new reports from scratch causes the same results in production and development. So its not anything specific that has been changed in the two versions (which are identical)
3) Putting the NAME Like 'BEL%' directly into the SQL clause of the report produces quick returns in production so the problem is not the APEX user not seeing the indexes for some reason. It also ensures that any data differences in the two databases are not the root cause of this.
So my only theory is that somehow the use of the Like filter does not allow the index on the NAME column to be used but only in production. Any ideas ... I am at a loss.
Edited by: user491396 on Jan 7, 2009 2:18 PM

g.myers wrote:
Apex does run the query the same way a direct connection does. It gets parsed, bind variables are peeked and an optimizer plan produced.
You have a query performance problem, not an Apex problem.
Oracle manages all SQL this way, irrespective of where it comes from.
Since we can only see the view, and not the full query (ie with all the tables, joins, predicates...) it is all pretty much guesswork for us.
It could be either the initial bind value (ie what was in the variable originally queried). If it was '%', then as a predicate it is pretty much useless. Your application should either prevent a '%' in the first character, or generate a separate SQL for that. If the '%' was the second character, then (depending on data volumes and data distribution) that may also result in a poorly performing plan.
Depending on db version you could look at v$sql_bind_capture for that SQL and see what values were used for peeking.
How many rows in DT_SCADA_TAGS ? The full table scan entry suggests you have 75 million in DT_SCADA_VALUES
The hash join between DT_SCADA_DATETIMES and DT_SCADA_VALUES suggests that there isn't a decent join path between the two (eg no date index on DT_SCADA_VALUES or one that indicates a low selectivity).Through testing the initial bind variable does not impact what the performance is ... even if its a full unique value without % it does not work any different. In this capture it was a full value 'BEL2395489'. There is 75 Million rows in DT_SCADA_VALUES. There is indexes on the dates and tag_names. I'll post the view for completeness at the end.
The outstanding issue/knowledge from here is that an APEX Filter using LIKE may be handled differently then a LIKE within the initial SQL by the parser and may lead to .
SELECT DT_SCADA_DATETIMES.DT_SCADA_DATETIME AS DT_SCADA_DATETIME,
       DT_SCADA_TAGS.TAG_NAME AS TAG_NAME,
       DT_SCADA_TAGS.TAG_DESCRIPTION AS TAG_DESCRIPTION,
       DT_SCADA_VALUES.ACTUAL_VALUE AS ACTUAL_VALUE,
       DT_SCADA_VALUES.MIN_VALUE AS MIN_VALUE,
       DT_SCADA_VALUES.MAX_VALUE AS MAX_VALUE,
       DT_SCADA_VALUES.AVG_VALUE AS AVG_VALUE,
       TRUNC(DT_SCADA_DATETIMES.DT_SCADA_DATETIME) AS DT_SCADA_DATE,
       TO_NUMBER(TO_CHAR(DT_SCADA_DATETIMES.DT_SCADA_DATETIME, 'HH24')) AS DT_SCADA_HR,
       TO_NUMBER(TO_CHAR(DT_SCADA_DATETIMES.DT_SCADA_DATETIME, 'MM')) AS DT_SCADA_MONTH,
       TO_NUMBER(TO_CHAR(DT_SCADA_DATETIMES.DT_SCADA_DATETIME, 'YYYY')) AS DT_SCADA_YEAR,
       TO_NUMBER(TO_CHAR(DT_SCADA_DATETIMES.DT_SCADA_DATETIME, 'DD')) AS DT_SCADA_DAY
  FROM
       DT_SCADA_TAGS   DT_SCADA_TAGS,
       DT_SCADA_VALUES DT_SCADA_VALUES,
       DT_SCADA_DATETIMES DT_SCADA_DATETIMES
WHERE DT_SCADA_DATETIMES.DT_SCADA_DATETIME_ID =
       DT_SCADA_VALUES.DT_SCADA_DATETIME_ID
   AND DT_SCADA_TAGS.DT_SCADA_TAG_ID = DT_SCADA_VALUES.DT_SCADA_TAG_ID
ORDER BY DT_SCADA_DATETIME DESC, DT_SCADA_TAGS.TAG_NAME

Similar Messages

  • Select Performance problems using the 'like' operator

    I have a PL/SQL procedure that uses a cursor which contains a 'like' operator in the where clause. I have two database instances that are theoretically the same, however this code processes about 100,000 rows in 5 minutes on one database and 100,000 rows in several weeks on the other database. I know it is the 'like' operator that is causing the problem, but I don't know where to look in the database setup parameters as to what could be different between the two. Can someone point me in the right direction?

    I tried to think of another way to write the query, but I really need to use the wildcard option on the data I'm searching for. The system I'm working with attaches a suffix to the end of every ID (ie. '214-222-1234-0') The suffix ('-0') increments but the rest of the ID stays the same ('-1','-2',etc...), but I want to find all of the rows where the first 12 characters are the same, so I strip off the suffix and use a wildcard '%' in its place. I tried adding the SUBSTR() function to the left hand column of the where clause, but it was even slower than using the 'like' operator. I know its a sound query, I just can't figure out why it works fine on one database and not the other.

  • I have PS CC. If I download PS CS3, to be able to use an older filter, will it mess up my CC settings and performance?

    I have PS CC. If I download PS CS3, to be able to use an older filter, will it mess up my CC settings and performance?

    Hi Digitalartist,
    It will not affect the performance but it might change the default to CS3 Photoshop.
    You might check in bridge for the file associations whether the extensions like Jpegs, PSD etc have Photoshop CC selected.
    Also check the default program for the images if you are directly opening images with Photoshop.
    Thanks

  • How do I set the "reply to" field in the iPad 2 Mail app?  I use an email forwarding service (not an actual email account) that I would like people to reply to.

    How do I set the "reply to" field in the iPad 2 Mail app?  I use an email forwarding service (not an actual email account) that I would like people to reply to, so setting up an account with the correct reply-to address doesn't work because there's no associated outgoing mail server.  I had this working under iOS4 but it seems to have disappeared when I upgraded to iOS5.

    Welcome to the forum, NicoleYM. I don't think the Touch Mail has as many options as the Mac Mail app. However, you could set a standard signature. Go to Settings > Mail, Contacts, Calendars > Signature. There you can type a reply address and hope people see it.
    Alternatively, you can go to your GMail account in your web browser and click on Settings > Forwarding and POP/IMAP. There you will have an option to forward all emails (or only some, if you set up a filter) to your other address.
    Good luck!

  • Im tryting to install new itunes but says windows installer, you are tring to use is a network resource that is unavailable. find folder itunes.msi  i dont have a folder like that and anything i use that is related does not work. help me?

    "you are tring to use is a network resource that is unavailable. find folder itunes.msi" i dont have a folder like that and anything i use that is related does not work. ive tryed to uninstall but still does the same thing when.

    Should the advice above not fix things for you...
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

  • How do I access "Firefox is NOT compatible with this application. For best performance, please use Internet Explorer 5.0 and above...." web sites; when I try to download any alternate browser, then a warning that alternate is "imcompatable with your opera

    How do I access websites that warn: "Firefox is NOT compatible with this application. For best performance, please use Internet Explorer 5.0 and above...."? When I try to download any alternate browser, all I get is another warning that the alternate is "not compatible with your operating system." Is Firefox preventing this? The site listed below is a job application site. I've had this same problem with other job application sites also.
    == URL of affected sites ==
    https://storefront.kenexa.com/lithia/cc/Home.ss

    There should be a User Agent Switcher menu item under Tools, which gives you the browser names you can impersonate.
    The menu item name changes to the browser UA you are presently using.
    There is also a User Agent Switcher button, you can add it using View -> Toolbars -> Customize, and dragging the button to your toolbar.
    See http://chrispederick.com/work/user-agent-switcher/features/ and http://chrispederick.com/work/user-agent-switcher/help/
    You can just start trying IE versions (or the versions it says on the site) until it lets you in.

  • When I use my IPhone 4S to view the Shaw Go Movie Central App when I am at home I only use WiFi which is automatic, I start watching a show and sometimes I will get a message like "you can not use your cellular for video playback" or something close to th

    When I use my IPhone 4S to view the Shaw Go Movie Central App when I am at home I only use WiFi which is automatic, I start watching a show and sometimes I will get a message like "you can not use your cellular for video playback" or something close to that. Then I received an email from Telus saying I had used my 3G instead of Wi-Fi  using 75% of my data. How can this happen when I'm on Wi-Fi at home? If it switched to 3G for some reason I should have been disconnected and not just transferred to 3G network using up my data. What is the fix for this??

    It doesn't have to be that complicated, Verizon iPhones come unlocked, just tell VZ you're going on Holiday/Traveling and suspend the service, no need to pay for service if you're not going to be using it. Pick up local SIM cards in the countries of your choosing, pop them in, re-activate iMessage and you're set!
    I recommend getting a SIM card from the Three network in England, they have great EU roaming rates and free like-home roaming in Italy.
    Set your phone's region to match the country you're in, it'll save from some headaches when calling local/international numbers.
    To answer your questions,
    1. If you choose not to have a local SIM card, it is good to keep your phone in Airplane mode to save battery.
    2. Make sure the two iPhones have different names to reduce sync/restore issues.
    3. If husband has an iPhone also, you can chat with iMessage/Facetime, just give him heads up about the new number you'll have. Otherwise, use Whatsapp if he's got an Android. You can activate Whatsapp with your American number or the international number if you choose to get a SIM in Europe.
    Also, Get the MagicJack app and/or Google Hangouts, both of those apps provide you with free calling to the USA and Canada using any internet connection. Google Voice is another good way to SMS across the seas.
    Let me know if you need any more tips for iPhoning across the pond.

  • HT4436 I am using IOS 4.1 in Ipod touch. I would like to take my data back using icloud. I am not able to enable icloud in to my ipod touch. please help me for the same.

    I am using IOS 4.1 in Ipod touch. I would like to take my data back using icloud. I am not able to enable icloud in to my ipod touch. please help me for the same. Basically I am trying to take back to upgrade my ios to 5 or 6 version.

    You can't back up to iCloud until you update to iOS 5 or higher.  You will have to back up your iPod on your computer using iTunes.  Update iTunes on your computer to the latest version, then connect your iPod to your computer, open iTunes, if iTunes give you a pop-up asking if you want to update your iPod, decline.  Then click on the name of your iPod in iTunes, go to File>Devices>Transfer Purchases to transfer any purchased media to your iTunes library.  Next, go to the Summary tab of your iTunes sync settings and click on Back Up Now to back up your iPod on your computer.
    When it's done backing up, click on Check for Update (or Update) on the Summary tab of your iTunes sync settings.  Allow your iPod to update, and leave it connected to your computer.  At the end, it will restart and give you the option to restore to the iTunes backup you made earlier.  Choose this option to restore your backup and sync your apps and other iTuens media to your phone.
    This process is outlined in this article: http://support.apple.com/kb/HT4972, under "If you are attempting to update using a Mac or PC with which you normally sync".

  • PPS dynamic filter creation - not your normal thing but we need a solution, dont think Performance Point can handle it!

    My challenge at the moment is that I need to create a dynamic filter. To explain this is a cascading filter but not your normal cascading filter,
    ie, Year/Month/day etc.
    Here we have a single Dimension, Organisation. It contains every level of a business,
    Site,
    Dept, 
    Company name,
    Division
    Holding
    Strategic Area
    From these as a default we have 4 built hierarchies with a different combination of the above.
    Activity (Strategic Area, Dept)
    Organisation (company Name, site, Dept)
    Sites (Division, Site)
    Holdings(Holding, Strategic Area, site, Dept)
    At any given time we have have additional Hierarchies created within the Dimension, further adding to the hierarchy list.
    We now have a challenge where we require our users to be able to in the first filter select the Hierarchy they want to use, ie, Holdings, Site, Organisation
    or Activity. This should then cascade to the second filter and contain the relevant hierarchy and levels as a multi select filter. Of course this also needs to be connected to number of graphs, charts and scorecards on the page, dynamically. 
    I have gone around the houses to get this to work but not having any luck. Tried the variety of filters available, MDX, member selection, tabular,
    SharePoint, and attempted to mix and match to get this to work. I cannot find a way but I don't believe this is not possible.
    If it is not possible we must look around for another front end solution for our BI Dashboards which I would prefer to avoid. Any response or suggestion
    would be much appreciated.
    Regards,
    Sheb

    Hi Sheb,
    Please check the articles below and see if cascading filter in PerformancePoint Dashboard can be help:
    http://technet.microsoft.com/en-us/library/hh272541(v=office.15).aspx
    http://www.dotnetcurry.com/showarticle.aspx?ID=872
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Hi connally25,
    Below is a link to a video tutorial on how to add a Facebook Log button, please check if you have followed the same steps to add the video.
    http://tv.adobe.com/watch/learn-adobe-muse-cc/adding-a-facebook-like-button/
    If you have followed the steps correctly and the button still does not work; here is a link to a forum thread which might help solving the issue:
    Facebook Follow Widget not working
    Regards
    Sonam

  • I would like to sync Notes between my MacBook Air and the IPhone and/or IPad.  I used to tick a box in Itunes (info), but for some reason it is no longer there.  How do I go about doing the sync?

    I would like to sync Notes between my MacBook Air and the IPhone and/or IPad.  I used to tick a box in Itunes (info), but for some reason it is no longer there.  How do I go about doing the sync?

    The only way to sync Notes is through a mail server. If you don't want to use iCloud, you'll have to use some other mail account, or run your own mail server under OS X Server. The latter is a job for advanced users only.

  • The pdfs that are produce in Word are very large. I need a method of compressing them variably - not just a quick reduction using the quartz filter.  Is their a suitable free compression programme,

    The pdfs that I produce in Word are very large. I need a method of compressing them variably - not just a quick reduction using the quartz filter.  Is their a suitable free compression programme,

    PDF Shrink for Mac
    Compress PDF – Reduce your PDF Online
    PdfCompress for Mac

  • User domain\SPFservice is not authorized to perform request using authentication type Negotiate

    Hi,
    I have installed WAP/SPF in the same domain via express installation.  The SPF domain service account is sysadmin on the SPF database.  The SPF domain service account is running as identity in IIS application pool.  I have registered SPF in
    WAP via SPFcomputeraccount\LocalSPFaccount.  The LocalSPFaccount is member of the 4 local groups created by the SPF setup.  The domain SPF service account is member of the VMM administrators.
    When a new tenant want to subscribe to a hosting plan I get an error "One or more errors occurred while contacting the underlying resource providers. The operation may be partially completed. Details: Failed to create subscription".
    When I look in the eventviewer of the SPF server in ManagementODataService, I can see "User domain\SPFservice is not authorized to perform request using authentication type Negotiate".
    SPF/VMM are both on the latest update rollup.  The VMM console is also updated on the SPF server. 
    I can successfully reproduce the troubleshooting steps from http://blogs.technet.com/b/privatecloud/archive/2013/11/08/troubleshooting-windows-azure-pack-spf-amp-vmm.aspx.

    Hi,
    During the install it is also asking you to specify groups during the installation (4 x) Is the user you specified als spf runas account also member of those group in the AD?
    So you have 4 groups created on the local box by the installation. But also 4 specified during the installation. Check if the account is member of those group(s) as well, reboot the spf and you should be up and running.
    Best regards, Mark Scholman. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • I want a soundbar for my 6th generation nano but am having trouble finding a compatible device. I'd like more than a dock, ideally a soundbar with wireless subwoofer. I'll only use the soundbar for music, not TV home theater. Any suggestions?

    I want a soundbar for my 6th generation nano but am having trouble finding a compatible device. I'd like more than a dock, ideally a soundbar with wireless subwoofer. I'll only use the soundbar for music, not TV home theater. Any suggestions? Thanks.

    Google

  • HT4437 I would like to use Airplay but I'm not how to?iv got IPad 2 Apple

    I would like to use Airplay n AirPrint but not sure how to?iv got iPad 2.

    Look here:
    http://roaringapps.com/

Maybe you are looking for

  • Content repository does not exist

    Hi, Kindly see the way we are creating the SAP content repository pointing to an external content repository which is our own DMS server. Our server is returning the success status in CSAdmin.  But customizing is being shown as missing. When I click

  • Adding a field in movement 561 with transaction MB1C

    Hi! I would like to add a field (FISTL - found center) for movement type 561. I went in OMJJ and made field FISTL mandatory. The thing is that if I use MIGO and movement 561, the field is available and it's working corectly. What I would like is to u

  • Anyone able to get Talktalk email working on iphone 4s?

    Does Talktalk email ever work on iphones? I can receive emails but can't send them; it always says 'rejected by server'. Spoke to Talktalk and they say all the settings are correct. Help please if you can. Thks

  • Logging Subsystem

    Hi, I would like to create a new Logging subsystem entry in the select list that is available for the Domain log filter(the one that does include EJB, Cluster, RMI, IIOP etc..). In my application code I do: new weblogic.logging.NonCatalogLogger("MySu

  • Issue with Smartform Font Style/Size

    Hi All, I have created some paragraph formats with font style "Times" & size such as 8,9,12 pt. Used the same in some smartforms, which is working fine in my testing server. When I transported the same to my quality server the output of Smartforms ar