Index is not used (why and what should i do) table too big

hi guys,
having a headache now. (on 10gR2 on linux system)
I used to have a large table and this is how i managed it. (i am on standard edition (thus i have no partitioning)
i would have a
1) cron job run daily to keep track of the lowest and highest ID of the table PER MONTH (inserted into a table)
2) below is the table
CDR     MONTH     01-AUG-11 00:00:00     94118236     97584656
CDR     MONTH     01-SEP-11 00:00:00     97581362     100573669
CDR     MONTH     01-OCT-11 00:00:00     100570865     103631203
CDR     MONTH     01-NOV-11 00:00:00     103629760     106497084
CDR     MONTH     01-DEC-11 00:00:00     106494085     107306335
so as you can see, for the month of dec for example, the lowest CDR is 10649408 and the highest is 107306335.
3) so everytime i write a sql on this table if i want to get data for NOV
select * from cdr where ID >= get_cdr_id('CDR','NOV','SMALLEST');
and it would be
select * from cdr where ID >= 103629760;
In the past, the index will be used (index range scan), but now the optimiser is doing a FTS and is taking too much time.
therefore i went to force the index
select /*+INDEX(C, CDR_PK)*/* from cdr C where cdr_id > 103629760 and cdr_id < 106497084;
and the COST -> 1678927 (CDR, INDEX_ROWID)
13158 (CDR_PK, RANGE SCAN)
-- the result return is fast and good.
without the index
select * from cdr C where cdr_id > 100570865 and cdr_id < 103631203
the COST -> 440236 (CDR,FULL)
-- but the result return is slow like anything
My question is
1) which cost should i look at ?
the one with index hint have much higher COST, but the results return are so FAST.
1678927 (with hint) compare with 440236 (FTS)
2) is using the index is the correct way, why isnt my optimiser using it ?! how do i make the optimiser used it ?
Regards,
Noob

Iordan Iotzov wrote:
About the clustering factor– I think there are two possibilities:
1) The “clustering factor” is generally correct, i.e. it represents the true value of how the data is “scattered” through the table. The clustering factor for the fragment of data you are interested in (where cdr_id > 100570865 and cdr_id < 103631203), however, is different (smaller).
2)Oracle did not compute the “clustering factor” correctly. It is not uncommon occurrence, particularly in 10g. This blog entry by Randolf Geist is quite informative - http://oracle-randolf.blogspot.com/2010/01/clusteringfactor-what-if-analysis.html. Comprehensive information on that topic is available in Jonathan Lewis’ book Cost Based Oracle Fundamentals (chapter 5).
You can make the index more attractive by setting lower “clustering factor” value using DBMS_STATS.SET_INDEX_STATS. If you choose to do that, you should review your whole stats gathering procedure, because the next gathering would most likely reset the “clustering factor” to its old (high) value.
Iordan Iotzov
http://iiotzov.wordpress.com/

Similar Messages

  • My Ipad was hacked. I can not use it. What should i do?

    My Ipad was hacked. I can not use it. What should i do?

    Then call Apple and speak to someone in account security. Someone has logged on to iCloud using YOUR Apple ID and used Find my iPad to lock the device. They are now, apparently, trying to collect a ransom from you to release it.
    The device was not hacked. Your account was. If you had set up two factor authentication, that wouldn't have been possible. You should really do that after you get this fixed.
    You may also want to report the extortion attempt to the police.

  • HT4759 ON MY IPAD I HAVE AVAILABLE 22.4GB AND YET IT SAYS I CANNOT DOWNLOAD ITEMS BECAUSE I AM SHORT OF 11GB SPACE WHY AND WHAT SHOULD I DO PLEASE?

    ON MY IPAD I HAVE AVAILABLE 22.4GB IN MY ICLOUD AND YET IT SAYS I CANNOT DOWNLOAD ITEMS BECAUSE I AM SHORT OF 11GB SPACE WHEN I HAVE 22.4GB, WHY AND WHAT SHOULD I DO PLS?

    Icloud storage is the one you can purchase for 40 bucks for a year and you didn't need to do that - 5 free seem to be enough for you.
    Ipad storage can be only "increased" by buying new bigger sized ipad. Apple makes those up to 128 Gigabyte in size now, but that will cost you a bit more the 40 bucks.

  • TS1436 When trying to burn a cd I get "disc recording not found" why and what can I do

    When trying to burn a cd I get "recording not found". Why and what can I do to change this. I do have Windows Media player loaded tried to to burn on that also but did not work.

    I have the same problem as simtagman. Would you mind looking at my diagnostics?
    Microsoft Windows 7 Home Premium Edition (Build 7600)
    Dell Inc. OptiPlex 745
    iTunes 11.0.1.12
    QuickTime not available
    FairPlay 2.2.32
    Apple Application Support 2.3.2
    iPod Updater Library 10.0d2
    CD Driver 2.2.3.0
    CD Driver DLL 2.1.3.1
    Apple Mobile Device 6.0.1.3
    Apple Mobile Device Driver not found.
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.6.502
    Gracenote MusicID 1.9.6.115
    Gracenote Submit 1.9.6.143
    Gracenote DSP 1.9.6.45
    iTunes Serial Number 00**********DA0
    Current user is not an administrator.
    The current local date and time is 2013-01-30 20:37:00.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is not supported.
    Core Media is not supported. (16005)
    Video Display Information
    Intel Corporation, Intel(R)  Q965/Q963 Express Chipset Family
    Intel Corporation, Intel(R)  Q965/Q963 Express Chipset Family
    **** External Plug-ins Information ****
    No external plug-ins installed.
    iPodService 11.0.1.12 is currently running.
    iTunesHelper 11.0.1.12 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    **** CD/DVD Drive Tests ****
    No drivers in LowerFilters.
    UpperFilters: GEARAspiWDM (2.2.3.0),
    D: SONY DVD-ROM DDU1615S, Rev EDS3
    Audio CD in drive.
    Found 12 songs on CD, playing time 47:22 on Audio CD.
    Track 1, start time 00:02:00
    Track 2, start time 03:58:33
    Track 3, start time 08:07:13
    Track 4, start time 11:52:03
    Track 5, start time 17:18:13
    Track 6, start time 20:39:28
    Track 7, start time 23:42:71
    Track 8, start time 28:40:61
    Track 9, start time 32:44:72
    Track 10, start time 37:00:26
    Track 11, start time 40:09:35
    Track 12, start time 43:05:43
    Audio CD reading succeeded.
    Get drive speed succeeded.
    <Edited by Host>

  • When i open imovie, it freezes. why, and what should i do?

    I have a very important project to do for school and have to give it back next week. It's on iMovie, and it's a 54minutes video. Since yesterday, I have a problem. I don't know if because it's too big, but when I open it, it freezes, and the little rainbow turns and turns and turns..... And because of that projects, I can't start any other project, and I can't go on any other project. That really freaks me out. PLEASE HELP ME!

    Try this:
    1. Quit iMovie
    2. Restart the Mac
    3. Repair permissions (open Disk Utility in your Applications/Utilities folder), select Macintosh HD and choose repair Permissions from the buttons displayed
    4. Move iMovie preferences (or trash them). They're at <your usenrame>/Library/Preferences/com.apple.iMovieApp.pList (the name might vary slightly, depending, but will always start com.apple.iMovie...)
    5. Delete the iMovie cache (in <your username>/Library/Caches, called com.apple.iMovieApp or similar. Delete the whole folder
    6. Restart the Mac.
    Hopefully, that will fix it

  • Hi, when i open iphoto, it only appears a sign that says "This device photo library is being updated" and i can not use the app, what should i do?

    Can u help me ?

    Well if you have no back up you need to make a back up now. It might be too late, but you're not going to know until you fix this.
    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store
    Then try:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • NPF is not running? Why and what should I do to troubleshoot?

    I got this NPF error warning when trying to install wireshark and duno how to troubleshoot. Any idea?

    NPF is the WinPcap (Windows Packet Capture) driver installed by Wireshark. (You must ensure the option to install WinPcap is selected when you install Wireshark, unless you have previously installed WinPcap). WinPcap requires administrator privileges to
    load. For the three possible solutions to start Wireshark with the privileges necessary to capture, please read:
    http://wiki.wireshark.org/CaptureSetup/CapturePrivileges

  • What does "java not detected" mean and what should I do about it?

    I am a teacher who teaches partly online. While trying to use Screen Recorder in Kaltura Media Space to record my desktop with audio voiceover, I encountered this message in red and was not able to use this device? I am not sure what the message means or how to fix this. I am using MacOS 10.9.1 and Safari. MediaSpace is provided by our school system, so I am not able to use my iPad to do this.

    Do you have a Java Preference Pane in System Preferences? if not, Java isn't installed and from your description, it sounds like it may be required. You can also try running this Java Test.
    Java Test
    Java

  • Magsafe adaptor sparks and burnt,why and what should i do?

    i was working with my mac pro(working with 3d max software)with my adaptor plug in to my mac charging it that suddenly i heard sparkling noise  ,as the power gone along with this noise i thought maybe its the matter of lack of electricity that cause my adaptor stop charging but when i notice i understand its the fuse,after i solve it and power came i saw that my adaptor no longer charge my mac.is it burnt?will it be repaired or i should by a new one?(my adaptor along my mac is 4 month old)

    AI DA,
    You should absolutely call AppleCare (1-800-APL-CARE / 1-800-275- 2273) immediately!  If you are unsure on calling or for some reason cannot, there are live chat options available.  Head over to getsupport.apple.com to explore all of the available options!
    Of course, if those options do not work for you, immediately, unplug the MagSafe Charger from both the wall and the computer and do not plug it back in until getting it to an Apple Retail Store or Apple Authorized Service Provider.  Both of which can be located at locate.apple.com.
    Your safety here is more important than anything else!  Don't continue to use any electronic device that is shocking you, or appears to be burning or have been burnt!
    ~~
    Austin

  • When I watch a streamed movie through my Apple TV re netflix I usually lose viewing. It tells me it their is not internet contact. I am not sure why and what to do.! Help !

    I lose connection while watching a streamed movie. The mesage on my TV says I am not connected to the interent. This usually happens about 30 minutes into the movie. I use Apple TV. Can you suggest what to do to prevent this problem?

    I assume you'reon wi-fi - presumably connection with the router is being lost for some reason - can you connect via ethernet to test if that's more stable?

  • Our air mac all of a sudden displayed a console warning box, why, and what should i do?

    Our mac air has given us a warning via console. I am not sure how to deal with it, I have verified disk permissions and stuff but what do I do?
    it includes messages like:
    4/27/14, 11:39:23 AM  kernal: wlEvent: en0 en0 Link UP virtif = 0
    10:10:37 AM imagent: [Warning] Denying xpc connection, task does not have entitlement: com.apple.private.icfcallserver   (soagent:2996)
    The second one is when the Warning Box happened
    Any idea what this means?
    Or what I can do?
    Thanks,
    JanetAq

    Thank you for the link!  I've read it and it kinda opens a whole new can of worms for me.  So if I understand correctly the xmp file stores Metadata because a .CR2 file cannot store the metadata inside of it.   And the storage of this information with the file is necessary if you make metadata changes in Lightroom, and then later want to open that file in a different program.  So if I ever decide to reorganize some of my raw files in Mac's Finder folders than all I have to do is make sure I move the xmp file along with it?  Not separate them? And then my other question is does the xmp file also store the changes I made in developer?  Like the white balance, exposure, lens corrections, etc...?

  • Gray lines (like etch a sketch lines) have appeared on my iPad 2 screen. Why and what should I do about them?

    Gray vertical lines have appeared on my iPad 2 screen. Much like an etch a sketch. What are they and is there anything that can be done about them?

    Do they stay in the same place whichever way up you hold the iPad, and do they still show when you've got an app open ?
    Have you tried a reset to see if they still show after the iPad has restarted ? Press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.
    If that doesn't fix it then you could try restoring to your backup and/or resettings back to factory defaults. But you may need to contact Apple.

  • I down loaded 4.0 as requested and now I have no emails showing for incoming, sent , trash etc? Why and what should I do?

    see same as trouble shooting info please. I really need to get this working please advise. Thanks

    Which web mail service are you using? <br />
    Have you tried getting help from them?

  • HT3702 My Master card card was rejected in the US store, it was issued in Jordan from Jordan Ahli Bank! However, it is accepted in the Jordanian store, any reason why? and what should i do to get to use the US store for future purchases?

    My Master card card was rejected in the US store, it was issued in Jordan from Jordan Ahli Bank! However, it is accepted in the Jordanian store, any reason why? and what should i do to get to use the US store for future purchases?

    Because they are the terms of use of the stores - terms from the US store :
    The iTunes Service is available to you only in the United States, its territories, and possessions. You agree not to use or attempt to use the iTunes Service from outside these locations. Apple may use technologies to verify your compliance.
    And similar terms apply to all other country's iTunes stores. Part of the reason is licensing (Apple can only sell content where the providers have granted them licenses to sell it), amd part might be due country's laws (some country's have restrictions as to what can be sold within their country). If there is content that you want that is not currently in the Jordanian store then you can try requesting that it be added (but the content providers might not let Apple sell it there) : http://www.apple.com/feedback/itunes.html

  • I used my friend itune to transfer songs to my iphone 4 but when i am using itunes from my laptop i am not able to tranfer songs to iphone.. but from my friends laptop is working.. why and what need to do ?

    I used my friend itune to transfer songs to my iphone 4 but when i am using itunes from my laptop i am not able to tranfer songs to iphone.. .. why and what need to do ?

    I would suggest that join your iphone with iTunes and do not sync. Than in your info window of iTunes uncheck auto sync of songs and videos. Check Mark for manual selection of songs. Also uncheck sync of songs window. After this sync your iphone and manually copy your songs from your iphone through itune by opening music under your iphone icon in the left status bar and copy to your laptop music folder. I think it would help out.  I did same for myself. Try out. TC

Maybe you are looking for

  • Why does my pointer keep on freezing?

    I have been having a problem with my pointer freezing and I have to shut down. I also use a magic mouse, not  sure if that has anything to do with it?

  • COMMIT

    Hi, I want to do a test, I loaded a table in DB2 from another table with 600,000 records, The problem is that there is many records and an error occurs, error+ --> Virtual storage or database resource is not available How it is possible to complete t

  • CiscoSecure ACS 3.3 and MS Active Directory ?

    We just got and installed CiscoSecure ACS 3.3 on a domain controller for our MS active directory domain. ACS seems to work with AD in the sense that it uses the usernames and passwords contained in AD for users. However I noticed it does not seem to

  • Changing root directory of JSDK server

    Hi There! I am running my servlet using JSDK 2.1. To run my servlet, I copy my class file to C:\jsdk2.1\examples\WEB-INF\servlets and could call my servlet using the URL http://localhost:8080/examples/servlet/classname. Now I want to create a subfold

  • Automate DRM metadata load into EPMA

    Hi, We are having metadata maintained in DRM, DRM provides an export in .ads file format, we load the .ads file into EPMA and create / updated dimensions. If any one can let us know if we can automate the process of loading the .ads output from DRM.