If the INSTR function will not use the INDEX o?

Hi all


I have a querry as
    Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0 ;
Is simple index on column Col1. If we use the index will be used or full table scan will happen in this scenario?

Please give me explanatory answer because I have doubts


Dhabas

Hello

You must use the index function if you want to avoid the full table scan. Check this box

SQL> create table tab1(col1 varchar(20))
  2  /

Table created.

SQL> insert into tab1 values ('XXAB')
  2  /

1 row created.

SQL> create index col1_idx on tab1(col1);

Index created.

SQL> explain plan for Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0;

Explained.

SQL> set autotrace on
SQL> Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0;
XXAB

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=5 Card=1 Bytes=12)
   1    0   TABLE ACCESS (FULL) OF 'TAB1' (TABLE) (Cost=5 Card=1 Bytes
          =12)

Statistics
----------------------------------------------------------
          4  recursive calls
          0  db block gets
         32  consistent gets
          0  physical reads
          0  redo size
        234  bytes sent via SQL*Net to client
        280  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed

SQL>  create index col1_idx2 on tab1(Instr(Col1,'XX'));

Index created.

SQL> Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0;
XXAB

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=12)
   1    0   TABLE ACCESS (BY INDEX ROWID) OF 'TAB1' (TABLE) (Cost=2 Ca
          rd=1 Bytes=12)

   2    1     INDEX (RANGE SCAN) OF 'COL1_IDX2' (INDEX) (Cost=1 Card=1
          )

Statistics
----------------------------------------------------------
         28  recursive calls
          0  db block gets
         22  consistent gets
          0  physical reads
          0  redo size
        234  bytes sent via SQL*Net to client
        280  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed

SQL> 

Thank you
AJ

Tags: Database

Similar Questions

  • Windows will start, the screen starts flashing and then the screen say Logging Off, then restore the screen to the CTRL ALT DEL all other functions will not work.

    Start my computer, it will default to the CTRL ALT DEL screen.  After graduating in the login screen I enter the password.  Windows will start and then the screen starts flashing and the screen say Logging Off, then restore the screen to the CTRL ALT DEL I can boot into safe mode.  All other functions will not work.

    Thank you

    I guess you wanted to ask how to solve the problem. If then all in Safe Mode you can use system restore to set up Windows to a point when the problem did not exist.

  • My Norton anti-virus software used to work and now it does not work with the new Firefox update. This corrected soon? Otherwise, I will not use the product

    Since your last update that my Norton toolbar will not work... If it does not work, will not use your product. Can it be fixed quickly?

    According to the article, I linked to before, you will need to update the norton version 2015.2.1.13 toolbar that is compatible.

  • Since the last update Photoshop CC will not use my GPU while Lightroom CC works. East of GPU Radeon HD 5700

    Since a recent update Photoshop CC will not use my GPU saying I do not have a minimum of 512 MB of vRam and wont let me enable it, even if I have 1 GB of vRam...

    When I load CC in Lightroom, it detects, is already selected for use.

    I use Windows 10 with 8 GB of ram and a Radeon HD 5700

    any ideas on how to fix.

    Go to the web site AND and download the most recent Wibdows 10 device driver for your graphics card.  It looks like you have installed is not correct.  No date shows no VRAM.

    glgpu [0]. GLVersion = "3.0".

    glgpu [0]. IsIntegratedGLGPU = 0

    glgpu [0]. GLMemoryMB = 0<>

    glgpu [0]. GLName ="? »<>

    glgpu [0]. GLVendor = "ATI Technologies Inc."

    glgpu [0]. GLVendorID = 0

    glgpu [0]. GLDriverVersion ="? »<>

    glgpu [0]. GLRectTextureSize = 16384

    glgpu [0]. GLRenderer = "AMD Radeon HD 5700 Series.

    glgpu [0]. GLRendererID = 0

    glgpu [0]. HasGLNPOTSupport = 1

    glgpu [0]. GLDriver ="? »<>

    glgpu [0]. GLDriverDate ="? »<>

  • T520 will not use any device DVD

    People,

    I was going to do a backup, when I noticed that the DVD player was no longer under my computer.

    I when in Device Manager, where he showed with a yellow X... I tried to update the device driver, it said that I had the right device. I've done many other things - nothing has worked.

    I really wanted to get the backup made, so I took my portable DVD player/burner and plugged. The laptop computer found a loaded device OK... but it does not appear in my computer. I had the same problem as the DVD drive internal.

    Then I got a USB drive external Passport, connected to the same USB port, no problems... He mounted the disk and I made the backup.

    My T520 will not use any device DVD... ideas?

    -Fred

    I did a quick search and voila. See the Windows 7 box.

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

  • Windows 7 firewall will not use recommended settings.

    "My windows firewall does nothing, when I go to stop or start it or anything in this menu, there's something that says:

    ----------------------------------------------------------------------------------------------------

    UPDATE YOUR FIREWALL SETTINGS

    Firewall Windows does not use recommended settings to help protect your computer

    ----------------------------------------------------------------------------------------------------

    Next there is a button with a shield and it says "use recommended settings".

    When I click that button of my mouse is that loading thing where it is just a circle with no cursor, it makes for a while and then nothing happens when its done. the same screen is still there with the same handwriting. It won't let me access anything that either and I can't even turn off and on again to fix it.

    I have Microsoft security essentials. It is a question that has been asked in 2010, but that is the exact problem I have and I can not find an answer.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-Security/Windows-7-firewall-will-not-use-recommended/33aafc1f-8c15-4518-9818-4cfc07b30801

    I tried

    netsh firewall reset - did not "netsh firewall is obsolete.

    netshfirewall reset ADV - has failed to "an error has occurred then that he was trying to contact the windows firewall service"
    netsh int ip reset - worked, but has not fixed the problem

    netsh winsock reset - worked, but has not fixed the problem

    Services

    firewall set to automatic but Windows does not start error message "Windows has no start windows on the local computer firewall."

    Base filtering engine is started and set to automatic

    authorization for the firewall driver Windows not found in services, so I went to the Device Manager/no plug-and-play driver found windows firewall authorization driver, but he says it was launched.

    Unfortunately, the methods you suggested did not work but I found a program called combofix and it solved my problem. But thanks for all the help you gave me.

  • ESX host will not use VMotion

    Hi all

    I have a question maybe someone can help.

    I installed two new ESX hosts in their own cluster, managed by a single data center environment.

    After the installation and updates, adding them to the Cluster environment and adding new licenses to the license server VC.

    I have one of the two ESX host who won't use VMotion. Everything is allowed as should be. But in the section of the Add On to the Configuration of the license, I see the following:

    VMware DRS Licensed for 2 cpu

    VirtualCenter for ESX Server Licensed agent for 2 cpu

    VMotion will not used

    VMware Consolidated Backup for 2 cpu license

    VMware HA under license for 2 cpu

    Additional details:

    Both servers in the cluster are identical hardware profiles: Intel 3.2Gig Xeon, 2 cavities 4 hearts, no HT.

    32Gig of RAM, (Proliant DL380 G5)

    The two servers connected to the SAN via Fibre Chanel Switch, redundant.

    Concert NIC ((VMNic 0 (Console 1), VMNic 1 (Standby adapter), VMNic 2 (Console 2) (the Virtual Machine Network), (VMkernel), (ports of vSwitch 56 none VLAN not defined) VMNic 3 (Standby adapter)).)

    No errors in the Logs of license, the Console message, etc. Everything seems in good health with no update needed.

    Both servers see the unique data store, created on the same SAN which it connects through the switch channel.

    VMFS 3.31.  Unique data store with several extensions (8 in total, the creation of a size of 15 to storage).

    Any ideas?

    All my other hosts using VMotion, but it does not work and there is no difference in configuration, I know.

    Thank you

    • FPTHREE

    Some of the most common problems that cause problems VMotion - have you enabled for VMotion vmkernel port? VMkernel ports on the same segments of entwork?

    Can you provide the ip addresses for your vmkernel enabled for vmotion -

    If you find this or any other answer useful please consider awarding points marking the answer correct or useful

  • If I buy Creative Cloud subscription should I used products only in connection or without an internet connection, I will not use this app?

    If I buy Creative Cloud subscription should I used products only in connection or without an internet connection, I will not use this app?

    Hi alperb33255764,

    You can use what you want, there is no such limitation. However when you go to cloud service based like loading or sync files to your cloud storage, you need an active Internet connection.

    I recommend you see this KB doc for more information on creative cloud: https://helpx.adobe.com/creative-cloud/kb/creative-cloud-connection-faq.html

    Kind regards

    Rahul

  • The firewall of Windows 8 will not use recommended settings.

    I have antivirus and firewall ZoneAlarm Security and will not turn on the Windows Firewall. I disabled ZoneAlarm firewall function and the firewall will not always use the recommended settings. I uninstalled ZoneAlarm and still the firewall do not use the recommended settings and activate. How can I fix this program?

    Are you kidding me? I said Windows 8 and you gave me solutions Windows 7?

    Although most of the solutions may apply to windows 8... And other suggestions check these steps... http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-Security/Windows-Firewall-service-cant-start/d322e0bd-10DC-4b85-B297-007133d91a9a

  • XP will not use home screen or ex-USSR since the upgrade AV...

    Running XP SP3 and I have recently updated my Norton Internet Security 2010 version and now my computer will not to several users connect at the same time or it will use a welcome screen.

    I looked into the user CP and both options are checked for the Welcome screen and the ex-USSR, but it won't work.  Ideas and more uninstall my antivirus? :-(

    gillweb,
    Thanks for posting on the Microsoft Answers forum.  Well, since the problem started with the Norton update then you can check with the help of Norton to see if they have seen this problem before.  You can try to perform a System Restore.  If that is not correct the problem then it can come down to remove Norton and then put it back.

    Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Can I remove Logical columns that I will not use in the layer of presentation as the id or foreign key columns?

    Hello

    Can I remove Logical columns at the level of the business layer that I'm not going to use the layer of presentation as the ID or foreign key columns? It will not affect the relations to the business layer?

    Kind regards

    Nestor

    Hi Nestor,.

    It won't unless they are used as keys, columns sort order, the ID column or the likes. But you can leave them in the MDB layer and expose just in the presentation layer - just in case you need it later. It is not use all the resources or generate overhead. More: Developer of the RPD should be used to work with loads of columns

  • Windows will not use the disks of backup file to restore, get "unknown error."

    Backup done recently will not work when you try to restore the files.  System indicates an "unspecified error" has occurred.  No clue on what is blocking recovery?   Thank you

    Hello

    see if this information helps you

    How to make a backup of your data

    http://www.vista4beginners.com/how-to-backup-your-data

    How to restore your files

    http://www.vista4beginners.com/how-to-restore-files

    the 1st link below is how do the backup complete pc

    http://www.bleepingcomputer.com/tutorials/tutorial145.html

    and that is how do to recover the backup complete pc

    http://www.bleepingcomputer.com/tutorials/tutorial144.html

    and here is the information of microsoft in restoring a system image backup

    http://Windows.Microsoft.com/en-us/Windows-Vista/restore-your-computer-from-a-system-image-backup

    If you have problems, it's in here is a forum for microsoft specifically for backup issues

    http://social.technet.Microsoft.com/forums/en-us/WindowsBackup/threads

  • Computer will not use the drive when you restart.

    I have a Pavilion dv 9000 and had problems more and more lately (win explorer fails, application launcher fail, blue screens, crashes etc.).

    I decided to use the recovery disk that was created at first boot. According to all the manuals that I found (on - and offline), it is just to put the recovery disk in the DVD-ROM and restart.

    The problem is that nothing happens. The computer does not use the disk when it reboots.

    Anyone experienced the same problem with the recovery disk?

    I'm not having any other problems with the ROM, works perfektly once Windows is running.

    Thank you

    You may need to change the BIOS to do first the CD drive in the boot sequence to boot from the CD.  To do this, hold the screen that tells you the key F to push to enter the menu start or start of installation.  Push it quickly. Make the changes, save your work and exit.  Put the CD in the drive and reboot.  When you are prompted, press any key to boot from the CD.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • When the CBO would not use bitmap indexes available?

    I have a large data warehouse table in a star schema classic, with an index number of bitmap for the dimension tables. When you run queries that contain parameters for multiple indexes, the CBO will only use generally one or rarely two bitmap index.

    It seems to me that if the indexes are valid, statistics, the values of the parameters are present, etc and the CBO uses a bitmap index in an AND condition, he would like to use all those she could.

    there all the parameters that affect or bitmap how indexes him CBO will use? I'm looking for some advice on what to look for or research.

    Database is 11.2.0.3 base with no patch.

    Thanks in advance,

    Sean

    rp0428 - who has been deliberate because my question is not "how to solve this problem", that's exactly what I pointed out in my post. Just trying to see if there are all the controls to weight the decision-making community organizations in this area.

    OK - then let me simply state it.

    No - there are NO these parameters. But most of the posters are not really looking for a simple yes/no answer even if of many word of questions like that.

    See my response as of March 18, 2012 19:21 in this thread: https://community.oracle.com/message/10219613?

    Here I provide a simple table with SIX bitmap index, a query that uses predicates that combine values since the execution plan and the six columns indicating the different INDEX of BITMAP UNIQUE BITMAP, BITMAP or operations and BITMAP CONVERSION to ROWID.

    I won't repeat everything here, but this example should show you that Oracle will limit itself the way you suggest.

  • Repeat functions, will not change variable. Confused Reeeallly

    OK... So yes, I'm rehearsing a function that will essentially attachmovie on a 'field', an image based on the parameter.

    It's called AddID (i), and currently there are only 2 valid options, 0 and 1, showing the images, X and O.

    There is a button and theres a table and a function that shows a picture of the tile based on its ID value loaded from the table.

    My problem is:

    Everything works just great as if you repeat the function by clicking again, but...

    When we repeat the code function, all the tiles will be the Image of the last tile added.

    It's my script actionscript code.

    IDonTile = new Array();

    IDonTile = [0,0,1,0,0,1];

    _Global. Tile = 0;

    And that's my buttoncode.

    {We (Release)}
    AddID (IDonTile [_global. Tile]);                 This function adds the tile on my screen
    TileList.Text += TileSlot [_global. Tile];         It's actually a textfield debug to see what value is supposed to be responsible

    _Global. Tile += 1;                                    Therefore, the next time that the slab is added, the following value will be used as an identifier.

    }

    It works very well!

    If I click on this button 6 times, I'll have in the following order: X, X, O, X, X, O

    The debugging text field displays: 0,0,1,0,0,1

    BUT

    I want to add all 6 tiles instantly, I would just use the function in a loop for, or repeat 6 times, the code like this:

    {We (Release)}

    for (i = 0; i < 5; i ++) {}
    AddID (IDonTile [_global. Tile]);                 This function adds the tile on my screen
    TileList.Text += TileSlot [_global. Tile];         It's actually a textfield debug to see what value is supposed to be responsible

    _Global. Tile += 1;                                    Therefore, the next time that the slab is added, the following value will be used as an identifier.

    }

    }

    Text field to debug the poster: 0,0,1,0,0,1

    Which is in fact correct

    BUT ALL 6 TILES WILL BE: O, O, O, O, O, O

    It is 6 O

    AddID (i) function is only 10 lines long.

    I don't want to manually add my 6 windows, what should I do if I had 100 tiles

    I was wondering, is there something wrong on Actionscript 2?

    Should I switch to Actionscript 3 maybe this will work?

    Because if I can manually click on the button, and it works, it must be exactly the same if I have the Correct code by a loop of foor?

    I'm reaaaallly confuseddd T, T he shouldn't BAA like this

    Help, please!

    I thanks in advance for any response...

    Cause the last time I tried to ask for help, I had no...

    Here's a solution... If I have the function of rewriting and eliminate the use of the binding of the tile, it works.

    function AddID (iID) {}
    If (tiles<>
    {Switch (IID)}
    case 0:
    attachMovie ("X", "Tile", tilelayer, {+(iconwidth*tX), _y:ky+(iconheight*tY)}) _x:kx;})
    break;
    case 1:
    attachMovie ("O", "Tile", tilelayer, {+(iconwidth*tX), _y:ky+(iconheight*tY)}) _x:kx;})
    break;
    }
    addTile();
    }
    {if(Tiles==tilesets)}
    MsgBox.text = "You have nowhere to store. »
    }
    }

    If for some reason that is not desirable, then here's an alternative.  I think I've narrowed the problem to be one of the timing... something in the loop cannot react quickly enough to changing _global. Value of the tile and I suspect it's the attachMovie activity.  This solution involves slowing the speed at which the file is trying to reach movies...  The button that launches adding tiles place the following...

    {We (Release)}
    myInterval = setInterval (fillTiles, 10);
    }

    And in the code of the timeline, add the following...

    var myInterval;

    function fillTiles() {}
    If (_Global. Tile<>
    AddID (IDonTile [_global. Tile]);
    TileList.Text += IDonTile [_global. Tile]
    _Global. Tile += 1;
    } else {}
    clearInterval (myInterval);
    }
    }

Maybe you are looking for