Optimizer not use indexes even after giving the indication

Hi all

I wonder why the Optimixzer does not use the index in the query below
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod


SQL> select column_expression
  2  from ALL_IND_EXPRESSIONS
  3  where table_name like 'GTXN_DTL_V1'
  4  and index_name = 'IDX_TXN11_V1';

COLUMN_EXPRESSION
-----------------------------------------
TO_DATE("BOOKING_DATE",'YYYYMMDD')

SQL> select num_rows from all_tables
  2  where table_name like 'GTXN_DTL_V1';

  NUM_ROWS
----------
  29020867

SQL>  explain plan for select * from gtxn_dtl_v1 where to_date(booking_date,'yyyymmdd') = to_date('030109','DDMMRR');

Explained.

SQL> select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------
Plan hash value: 3140624094

---------------------------------------------------------------------------------
| Id  | Operation         | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |             | 55489 |    15M|   215K  (4)| 00:43:08 |
|*  1 |  TABLE ACCESS FULL| GTXN_DTL_V1 | 55489 |    15M|   215K  (4)| 00:43:08 |
---------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(TO_DATE("BOOKING_DATE",'yyyymmdd')=TO_DATE('030109','DDMMRR
              '))

14 rows selected.

--Giving Hint..

SQL> explain plan for select /*+ index(gtxn_dtl_v1 IDX_TXN11_V1) */ *
  2  from gtxn_dtl_v1
  3  where to_date(booking_date,'yyyymmdd') = to_date('030109','DDMMRR')
  4  /

Explained.

SQL> select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------
Plan hash value: 3140624094

---------------------------------------------------------------------------------
| Id  | Operation         | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |             | 55489 |    15M|   215K  (4)| 00:43:08 |
|*  1 |  TABLE ACCESS FULL| GTXN_DTL_V1 | 55489 |    15M|   215K  (4)| 00:43:08 |
---------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(TO_DATE("BOOKING_DATE",'yyyymmdd')=TO_DATE('030109','DDMMRR
              '))

14 rows selected.
Please suggest.

Thanks in advance,
Jac

Hello
you have created the index with uppercase letters (YYYYMMDD), but you try to run the query with small letters (YYYYMMDD), while acceptable with the name of the column it is not acceptable with a part of the function of the order of the function.

Yuri

Tags: Database

Similar Questions

  • I'm unable to install Adobe Creative Suite Design & Web Premium, even after entering the serial number under license. There is a message that says that the Adobe product much be not genuine. I have 8 licenses that I had installed on 2 computers avecjo

    I'm unable to install Adobe Creative Suite Design & Web Premium, even after entering the serial number under license. There is a message that says that the Adobe product much be not genuine. I have 8 licenses that I had installed on 2 computers with no problems. But the 3rd computer begins to complain that there cannot be a genuine version. I need some advice please.

    When you ask a question you will need to provide some basic information

    -Forum quick start https://forums.adobe.com/docs/DOC-5601

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    Using a full account of computer administrator with read/write permission?

    Software not valid https://helpx.adobe.com/x-productkb/global/digital-certificate-revoked-aam.html

    CS2, Acrobat 7 + Audition 3 (AND PREVIOUS) activation server has disappeared, then read below

    l http://helpx.adobe.com/x-productkb/Policy-Pricing/Creative-Suite-2-activation-end-Life.htm

    .

    You MUST use the special version and the serial number on the page, not your original drive or serial number

    .

    NOTE that CS2 will not install on a "modern" with an Intel Mac

    When you install the special version of CS2 on a Win7 or Win8 or Win10 computer, you may need to right click on the program icon and select compatibility Windows XP in the popup of option

  • I have tried to download/reinstall CS5 that my laptop current doesn't have a dvd drive, but even after downloading the files, it will not install

    I have tried to download/reinstall CS5 that my laptop current doesn't have a dvd drive, but even after downloading the files, it will not install

    When you ask a question you will need to provide some basic information

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    Using a full account of computer administrator with read/write permission?

  • My subscription Creative Cloud amounts and the teacher would not be repeated even after update payment information

    My subscription Creative Cloud amounts and the teacher would not be repeated even after update to payment information. I tried many times in the past two months, updating credit card information and I was never renewed. Subscription keeps saying expired beyond the 24 hour mark it says it will take. I have double and triple checked the information of credit card and have recorded several times. I also never get an e-mail confirmation or an e-mail saying that he had a problem. It is also very frustrating that it doesn't seem to be a customer service number to call especially for customers who have paid for the subscription of creative cloud. Help, please!

    Phone support | Orders, returns, exchanges

    http://helpx.Adobe.com/x-productkb/global/phone-support-orders.html

    To the link below, click on the still need help? option in the blue box below and choose the option to chat or by phone...
    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html ( http://adobe.ly/19llvMN )

  • New Microsoft Windows 7 Pro 64 workload on a Folio HP book - Windows will not update even after running the tool

    I received a book of 13-2000 HP Folio damaged software.  Had to reload Microsoft Windows 7 Pro 64.  Windows is not the updates even after running the Microsoft 'tool' and 'fix it tool.  What is the last manual way to solve this problem.

    What is the last manual way to solve this problem.

    The last manual is to install the latest version of the Windows update client.

    https://support.Microsoft.com/en-us/KB/3161647

    Best regards, VZ

  • Saitek cyborg keyboard does not work in Windows 7, even after downloading the drivers

    Saitek cyborg keyboard does not work in Windows 7, even after downloading the drivers. It says error tent install drivers try again.

    (a) has been the work of keyboard much earlier?

    http://support.Microsoft.com/kb/258826

    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

  • I tried EvevryThing! The "CREATED WITH ADOBE ELEMENTS 9 TRAIL VERSION FIRST" will not stop Displaying, even after I put in the serial number and Regerstered. Also the product does not show under my profile?

    I tried EvevryThing! The "CREATED WITH ADOBE ELEMENTS 9 TRAIL VERSION FIRST" will not stop Displaying, even after I put in the serial number and Regerstered. Also the product does not show under my profile?

    How can I fix it? Nothing in help or on the Site.

    Once you have registered the product, you should not see the banner of 'Trial' on NEW projects. This isn't the case, right? You only see on the project that you created before you register the product, right?

    That said, to remove the banner, go to the folder of directory on your hard drive where your project PREL files are stored and delete the folder called Adobe Premiere elements preview files.

  • I was not able to open my my Adobe Illustrator application after update. He says there are a few problems with the preference but after following the instructions, Illustrator still does not work and it keeps giving the samei question. Help, please.

    I was not able to open my my Adobe Illustrator application after update. He says there are a few problems with the preference but after following the instructions, Illustrator still does not work and it keeps giving the samei question. Help, please.

    I think you are talking after upgrade to CC 2015 you're not able to launch I. Also, I believe you speak for read only matter of preference.

    After following the instructions please do not launch Illustrator and check your file preference if the permissions have been set correctly. A good way would be to get inside the preferences folder and then try to create a file manually. If it succeeds, please write to [email protected]

    A few external links to help you set permissions:

    MAC

    OS X Yosemite: set permissions for items on your Mac

    WIN

    Set, view, change, or remove permissions on files and folders

    r-and-file-permissions/465f2b42-63dd-4486-8dd1-c870290efeed http://Answers.Microsoft.com/en-US/Windows/Forum/windows_vista-Files/How-do-i-change-folde

    Kind regards

    Ashutosh

  • Loading the Google's HTTPS version causes Firefox to do 3 background request every 45 seconds even after closing the page.

    Loading the Google's HTTPS version causes Firefox to do 3 background request every 45 seconds even after closing the page.
    With any other HTTPS sites that support HTTP Strict Transport Security (HST), I noticed connection only 1 history.
    How can I disable these background connections?

    Hello, I'm no expert on the matter, but it is quite possible that the spdy Protocol, which is used by google on its secure sites (twitter atm) and is causing the behavior that you have seen.

    "SPDY connections are persistent connections. For optimal performance, it is expected that clients will not close the open connections until the user navigates away from all web pages referring to a connection, or until the server closes the connection. Servers are encouraged from the connections open as long as possible, but can stop idle connections if necessary. »
    http://mbelshe.github.com/SPDY-specification/draft-mbelshe-SPDY-00.XML#RFC.section.2.1

    You can try to disable support for the spdy Protocol in firefox (in all: config) and see if that changes the number and length of connections to the server.

  • 11g R2 optimizer is not using indexes

    I have the table named OPT_TEST in my database 11g R2.
    There is an index on the ename column of the table above.
    11g does not use this index when I ask above table on the basis of the ename column.

    SQL > select count (*) in the opt_test;

    COUNT (*)
    ----------
    851969

    SQL > select count (*) in the opt_test where ename = 'KING '.

    COUNT (*)
    ----------
    1

    SQL > exec dbms_stats.gather_table_stats ('SCOTT', 'OPT_TEST', method_opt = > 'for all columns size skewonly');

    SQL > explain plan for select * from opt_test where ename = 'KING '.

    He explained.

    SQL > select parent_id, operation, options, object_name, id, io_cost from plan_table;

    ID PARENT_ID OPERATION OPTIONS OBJECT_NAME IO_COST
    ---------- ---------- ------------------------------ ------------------------------ ------------------------------ ----------
    0 SELECT STATEMENT 1365
    1 0 TABLE ACCESS FULL OPT_TEST 1365


    There is on one employee with the name 'KING' in the OPT_TEST table.
    I have also generated stats on the table and the index but still optimizer makes complete analysis.

    user8916506 wrote:

    SQL> select count(distinct ename) from opt_test ;
    
    COUNT(DISTINCTENAME)
    --------------------
    14
    
    SQL> select ename,count(*) from opt_test  group by ename;
    
    ENAME        COUNT(*)
    ---------- ----------
    ALLEN           65536
    JONES           65536
    FORD            65536
    CLARK           65536
    MILLER          65536
    SMITH           65536
    WARD            65536
    MARTIN          65536
    SCOTT           65536
    TURNER          65536
    ADAMS           65536
    BLAKE           65536
    KING                1
    JAMES           65536
    
    14 rows selected.
    

    The answer is b - I thought of:
    You enabled Oracle to make a sample auto size, and he stopped on a very small sample because he thought that he had obtained a stable result. But he has never seen the line after line with KING. Therefore, when you query for KING oracle saw "not in the histogram. For versions of Oracle 10.2.0.3 beyond estimation is then "half the number of lines for the least popular value', which comes to 32 768.

    Concerning
    Jonathan Lewis

  • SQL not using indexes at runtime, but by using the index in "explain plan".

    Hi all

    I am facing a problem here that I don't get to think.

    I have a SQL that makes a FULL ACCESS of TABLE into two tables and its costs are very high, but it occurs only when I run it in my program (I saw it in the session trace). If I do a "explain plan" sqlplus (SQL Navigator or PLSQL Developer) it shows that he use indexes and have a low cost. I already checked the statistics from both tables, and they are up to date.

    Did someone never facing a similar problem or knows something I can do to find my problem?

    Thank you all very much.

    Hello

    As far as I KNOW, optimizer Oracle never guarantees that an Index scan in query explain plan will be necessarily used during query execution.

    ORACLE-BASE - DBMS_XPLAN: Oracle display execution Plans

    Could you please read the above, run the query, as described and check the execution using DBMS_XPLAN plan. The cursor cache DISPLAY_CURSOR and not PLAN_TABLEs.

  • uanable to use AKO (Army Knowledge Online) due to problems with the certifacitate security, even after accepting the risks.

    I am familiar with the certificates page when you try to pull up of AKO. Today the attention risk security skipped upward, I pressed the button except add followed to obtain certificate. The window then informed me the site has a valid certificate, but still does not open the site.
    https://www.us.Army.mil/appiansuite/login/login.FCC?type=33554433 & REALMOID=06-000a4cd6-218f-1122-97EA-832f882f0000 & GUID = & SMAUTHREASON = 0 & Method = Get & SMAGENTNAME = $ SM$ 2f723ECL4% 2bJUIHQcnRMBd2KxCCSc % 3d % HP4c7QPYp2KtCVeQ & TARGET = $SM$ http % 3A % 2f % www.us.army.mil%3a81%2fsuite%2fauthenticate.do 2f

    After that I have meet the certificate warning and attempt to get around, I get this message:

    This site offers valid, verified identification. There is no need to add an exception.

    The warning popup still does not allow me to go to the page even after he claims the a valid certificate.

  • Plugin Flash will not install even after installing the latest version of Flash

    When I go to a site that contains Flash content, it says "a plugin is required to view this content" and there is a link to install the plugin. In addition, there is a message at the top of the page that says "additional plugins are required to display all the media on this page" with an option to "Install missing Plugins". I click on the link to install the missing plugin, and a dialog box appears that says "the following plugins are available: ' and 'Adobe Flash Player 11.0.1.152' lists with a checkbox next to it. The box is checked, and I click on 'Next' to install. He's going through the motions and then told me that 'no plugins were installed. There is a link to manually install the plugin, which brings me to the Adobe's Flash download page. I unchecked the box for pair McAfee Security download and downloaded the latest version of Flash (to be honest, I downloaded actually this exact version even about 10 times today). The dialog box appears, I save the file and once it has downloaded, open the folder that contains (my downloads folder). I then, close all programs (including Firefox) except for the folder of Windows Explorer I want to run the installer from. I double-click the Flash Installer to perform the installation. The installation process is complete, the installer tells me that the download is successful, and my browser opens upward with a message "Successful Installation" from the Adobe Web site. Yay! My installation is successful... Orrrrrr not. Return to the page with the Flash media - always have a message saying that I need the plugin. Try to download plugin once again... no dice.

    THEN, I go to "Manage my Add-ons" thinking maybe I need to activate the plugin. There is no plugin Flash (or Shockwave) listed on any of the menus - it is as if it does not exist.

    I downloaded the latest version of Java because I read somewhere that Flash requires Java work; I installed the "add-on Compatibility Reporter" so I could force Java to be enabled. It made no difference whatsoever, best I can tell.

    I also went to the Adobe homepage where you can see what version of Flash you use (http://www.adobe.com/software/flash/about/) and it does not even show that I have installed Flash. In Internet Explorer, it shows that I have installed Flash, but it's the previous version (but this is probably due to the fact that I downloaded Flash in Mozilla, not IE, and they use different modes in each browser - so an update that you download from a browser does not necessarily apply to the other browser).

    So in summary: I don't know what on Earth is wrong here, but I'm about as frustrated that I've never been in my life. I don't know why the installation of Adobe Flash is said she is successful (it sleeps for me?), but there is no plugin appear in my menu manage add-ons, and I googled all the possible combinations of content in this message and have not found a solution that works yet.

    It seems that you have found the 64-bit version of Flash. Is your Windows 7 64-bit?

    I did read your entire post, but NPSWF64_11_1_102.dll which is Flash 64-bit; This turns into a novel when it should have been a short story.

    First, uninstall all Flash your system by following these instructions from Adobe

    Second, get the 32-bit versions of the following. Why? Unless you use an unofficial Firefox 64-bit version, the regular Firefox is a 32-bit browser and needs 32-bit Flash.

    Third, test Flash on websites where you had a problem before.

    If this does not work, my last suggestion for you is to follow the instructions from Adobe for troubleshooting. I don't know what's happening with your system, which could possibly be the cause of the problem.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

  • The sidebar will not clear history, even after deletion of history, how to erase the sidebar history?

    Even after the erasure of history (FireFox 6.0.2) the sidebar history contains a story of friends.

    After you remove each item individually and say things to forget to each site, they all return.

    Any ideas on how to clear the history sidebar?

    One possible cause is a problem with the places.sqlite file that stores the bookmarks and history.

  • HP 3050 printer prints not clearly even after replacing the color and black cartridges...

    I have a problem on a HP 3050 printer all-in-one that is just a year old.  The printer is not used for several months and it was working properly before.  I tried to print a page and had missing horizontal print, I tried to clean the print heads and it did not help.  I replaced the cartridges with new ones and noticed that the ink levels showed that had the old cartridges.  Black was half full and the color was full.  It wasn't new purchased in-store cartridges refills.

    I tried to force an alignment page on the maintenance of the printer screen and this failed repeatedly, undetected alignment page.  I did some research and even tried to clean links them / connectors than cartridges fits.  Looks like that leaving the cartridges for several months in the printer was bad and that I'll need to ge a new printer.

    Thanks for the tips,

    plarr

    document here can help to solve the problems of print quality in your Deskjet 3050 has. I also suggest to clean the cartridge and printer electrical contacts as described in this document (for another series of cartridges, but same principle).

Maybe you are looking for

  • IAM blocked by software strategy, how to fix this

    When I try to open all programs it's c:\program files (then some program iam trying to open) says windows cannot open this program because it was prevented by a software restriction policy, for more of event viewer open information or contact system

  • Impossible to update Windows 7

    I have windows 7 on my computer and it will not update. When I check on the foslder of update in Control Panel, it says: never search for updates and updates have been installed for ever.  I tried several ways to fix it, but nothing works. Any ideas?

  • Eception Exception on Running Blackberry Messenger blackBerry smartphones

    Hello. Whenever I click on the Blackberry Messenger icon I get WARNING saying "Eception exception: java.lang, NullPointerException. The presentation text of techno in lglg log shows: Name: NullPointerExceptionGUID: 9c3cd62e3320b498Time: March 23, 200

  • Windows 7 freezes after the password entered

    It is a windows 7 Compaq Presario laptop. It freezes immediately after the entry of the password. It crashes in safe mode as well. When I go to command Mode need me to network mode so I can't run all the tests. The fan had run hard before, but I don'

  • ODI error when loading classic HFM Application data

    Hi allI'm the one stage integration of the source (flat file) at the request of HFM, I created it and loading data integration, I get the following error: -.org.apache.bsf.BSFException: exception of Jython:Traceback (most recent call changed):File '<