Why an empty directory take so much space?

Here is the problem:
[kokoko3k@Gozer ~]$ mkdir /tmp/testdir
[kokoko3k@Gozer ~]$ ls -la /tmp/|grep testdir
drwxr-xr-x 2 kokoko3k users 4096 7 feb 12.01 testdir
We have 4K, ok.
[kokoko3k@Gozer ~]$ cd /tmp/testdir/
[kokoko3k@Gozer testdir]$ while true ; do touch $RANDOM ; ls -1 |wc -l ; done
1
2
600
^C
[kokoko3k@Gozer testdir]$ ls -la /tmp/|grep testdir
drwxr-xr-x 2 kokoko3k users 20480 7 feb 12.02 testdir
20K makes sense, it is full of files, but look here:
[kokoko3k@Gozer testdir]$ rm /tmp/testdir/*
[kokoko3k@Gozer testdir]$ ls -la /tmp/|grep testdir
drwxr-xr-x 2 kokoko3k users 20480 7 feb 12.03 testdir
...now the directory is empty and still take so much space, i dropped caches but nothing changes, the only way to free it is to rmdir and mkdir again.
filesystem is ext4 and mount options are: defaults,barrier=0
Is this... normal?

I can clearly "rmdir /tmp/testdir", that means that the directory is empty, or rmdir reports an error, but here it is the log with du, this is on another box:
koko@slimer ~ ls -la /tmp/testdir
ls: cannot access /tmp/testdir: No such file or directory
koko@slimer ~mkdir /tmp/testdir
koko@slimer /tmp/testdir $ sudo du -sh /tmp/testdir
4,0K /tmp/testdir
koko@slimer ~cd /tmp/testdir
koko@slimer /tmp/testdir $ while true ; do touch $RANDOM ; ls -1 |wc -l ; done
1
2
3
648
649
650
651
^C
koko@slimer /tmp/testdir $ sudo du -sh /tmp/testdir
20K /tmp/testdir
koko@slimer /tmp/testdir $ cd ..
koko@slimer /tmp/testdir $ rm /tmp/testdir/*
koko@slimer /tmp/testdir $ sudo du -sh /tmp/testdir
20K /tmp/testdir
koko@slimer /tmp $ ls /tmp/testdir/ -la
totale 44
drwxr-xr-x 2 koko users 20480 7 feb 17.43 .
drwxrwxrwt 16 root root 20480 7 feb 17.49 ..
koko@slimer /tmp $ rmdir /tmp/testdir
koko@slimer /tmp $ mkdir /tmp/testdir
koko@slimer /tmp/testdir $ sudo du -sh /tmp/testdir
4,0K /tmp/testdir
Still, dir size become bigger when a lot of files are put into it, but never gets smaller, even after deleting all of the files.
Is it a bug?
-EDIT-
Seems to be expected...
http://serverfault.com/questions/294301 … lock-count
Last edited by kokoko3k (2012-02-07 16:58:06)

Similar Messages

  • Why does firefox's internet files take so much space on hard drive?

    Why does firefox's internet files take so much space on hard drive?For example, I have 9,80GD on disk and after looked 2 video on youtube(2-3 min each) it's become 9,60GB. It's 200MB gone!

    Diane Wordsmith wrote:
    If you did not see the dialog box asking if you wanted to delete from the hard drive, I think this may be one of those options where you can say "Don't ask again," meaning until you trash your iTunes prefs, it will cease asking the question.
    you can bring those dialogs back. iTunes > preferences > advanced > reset all dialog warnings
    JGG

  • Why does the messaging app take so much space (5.6??) Also when I try to delete messages, it still shows 5.6. help me!

    Hi,
    I have barely any space left on my phone. ios7 messaging app takes so much space. How can I stop this?

    Your phone needs more storage, buying storage on iCloud.com doesn't change that.
    Delete some of the stuff off of your phone, it's full.

  • I do not have many messages but my iphone 5s says messages take up 4.6GB of space.  When comparing with friends who have many more message, less than 1 GB is being used on their phones.  Why are mine taking up so much space and how do I correct that?

    I do not have that many messages on my new iPhone 5s (maybe about 15 conversations and only one or two going back a little ways) yet when I go to Settings, Usage it shows that my messages are taking up 4.6GB of space.  When comparing with others (some who have hundeds of messages) they are using under 1GB for their messages.  Why are mine taking up so much space??

    I found a post with this solution that worked for me - .Do a backup, then download ibackupbot. It lets you look into the contents of that backup. Look in system files>mediadomain>library>sms>attachments. I found a ton of huge files related to long deleted texts. ibackupbot let me delete all that old crap. I then restored the phone with that now modifec backup and Bingo! freed up 9 GB. No problems.
    But note, if you are not technically inclined you probaly don't want to be digging around and deleting back up files. You delete the wrong thing and you could jack up your phone badly. Be careful.

  • TM  backup takes too much space

    I restored the boot disk (Macintosh HD) from TM's last backup.
    The first new backup takes too much space on your external drive!
    Is it true?
    Macintosh HD:
    Capacity: 250.66 GB
    Available: 130.01 GB
    Message was edited by: tamias

    Thank you, I understand.
    I have 3 partitions and I just restored the system partition, the other two were normal.
    Macintosh HD:
    Capacity: 250.66 GB
    Available: 131.05 GB
    Writable: Yes
    File System: Journaled HFS+
    BSD Name: disk0s2
    Mount Point: /
    Work:
    Capacity: 374.11 GB
    Available: 160.36 GB
    Writable: Yes
    File System: Journaled HFS+
    BSD Name: disk0s3
    Mount Point: /Volumes/Work
    Extra:
    Capacity: 73.3 GB
    Available: 31.64 GB
    Writable: Yes
    File System: Journaled HFS+
    BSD Name: disk0s4
    Mount Point: /Volumes/Extra
    I must have three times to recover the system partition.
    I'm not sure that the drive for 1 year of operation is out of order. During the day the computer works fine, but every morning after wake up,
    when disc is cold ,
    and after 2 - 3 minutes go to freezing all apps. It seems that does not see the HDD.
    After a forced shutdown and restart the system sometimes can boot normally and without error in the file system, but often does not load.
    After several attempts to boot the system it is still loaded, but disk utility shows :
    2009-02-04 13:46:25 +0800: Verifying volume “Macintosh HD”
    Starting verification tool: 2009-02-04 13:46:25 +0800
    2009-02-04 13:47:53 +0800:
    2009-02-04 13:47:53 +0800: Performing live verification.
    2009-02-04 13:47:53 +0800: Checking Journaled HFS Plus volume.
    2009-02-04 13:47:53 +0800: Checking Extents Overflow file.
    2009-02-04 13:47:53 +0800: Checking Catalog file.
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: Incorrect block count for file indexr3_db
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: (It should be 2080 instead of 2264)
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: Incorrect block count for file indexr3_repo
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: (It should be 8932 instead of 9180)
    2009-02-04 13:47:53 +0800: Checking multi-linked files.
    2009-02-04 13:47:53 +0800: Checking Catalog hierarchy.
    2009-02-04 13:47:53 +0800: Checking Extended Attributes file.
    2009-02-04 13:47:53 +0800: Checking volume bitmap.
    2009-02-04 13:47:53 +0800: Checking volume information.
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: The volume Macintosh HD needs to be repaired.
    Repair can not restore the system partition. I restore the Macintosh HD from last backup and it works well deep into the night!
    Maybe temperature sensor does not work, or is a hard drive?
    Thank you, I understand.
    I have 3 partitions and I just restored the system partition, the other two were normal.
    Macintosh HD:
    Capacity: 250.66 GB
    Available: 131.05 GB
    Writable: Yes
    File System: Journaled HFS+
    BSD Name: disk0s2
    Mount Point: /
    Work:
    Capacity: 374.11 GB
    Available: 160.36 GB
    Writable: Yes
    File System: Journaled HFS+
    BSD Name: disk0s3
    Mount Point: /Volumes/Work
    Extra:
    Capacity: 73.3 GB
    Available: 31.64 GB
    Writable: Yes
    File System: Journaled HFS+
    BSD Name: disk0s4
    Mount Point: /Volumes/Extra
    I must have three times to recover the system partition.
    I'm not sure that the drive for 1 year of operation is out of order. During the day the computer works fine, but every morning after wake up,
    when disc is cold ,
    and after 2 - 3 minutes go to freezing all apps. It seems that does not see the HDD.
    After a forced shutdown and restart the system sometimes can boot normally and without error in the file system, but often does not load.
    After several attempts to boot the system it is still loaded, but disk utility shows :
    2009-02-04 13:46:25 +0800: Verifying volume “Macintosh HD”
    Starting verification tool: 2009-02-04 13:46:25 +0800
    2009-02-04 13:47:53 +0800:
    2009-02-04 13:47:53 +0800: Performing live verification.
    2009-02-04 13:47:53 +0800: Checking Journaled HFS Plus volume.
    2009-02-04 13:47:53 +0800: Checking Extents Overflow file.
    2009-02-04 13:47:53 +0800: Checking Catalog file.
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: Incorrect block count for file indexr3_db
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: (It should be 2080 instead of 2264)
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: Incorrect block count for file indexr3_repo
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: (It should be 8932 instead of 9180)
    2009-02-04 13:47:53 +0800: Checking multi-linked files.
    2009-02-04 13:47:53 +0800: Checking Catalog hierarchy.
    2009-02-04 13:47:53 +0800: Checking Extended Attributes file.
    2009-02-04 13:47:53 +0800: Checking volume bitmap.
    2009-02-04 13:47:53 +0800: Checking volume information.
    2009-02-04 13:47:53 +0800: 2009-02-04 13:47:53 +0800: The volume Macintosh HD needs to be repaired.
    Repair can not restore the system partition. I restore the Macintosh HD from last backup and it works well deep into the night!
    Maybe temperature sensor does not work, or is a hard drive?
    WDC WD7500AAKS
    Total Capacity : 698.6 GB (750,156,374,016 Bytes)
    Message was edited by: tamias

  • Does using GPRMs / scripts / stories take up much space?

    Hi all
    Does using GPRMs / scripts / stories take up much space??
    I ask this because a dvd I must complete tonight appears [on the disc meter in DVDSP] to take up 6.0 GB when the combined assets equal 3.85 GB AND NONE have been doubled up.
    I have stories that reuse the same main movie, a fair number of menus [without using DVDSP alpha transitions], scripts that point to loop points in menus, and a scripting combination that randomly plays 13 audio tracks with 300kB graphics for the video track.
    Anyone??? Please!

    I may have found where the size descrepency originates.
    The size of this project is associated with 13 menus.
    Each of these menus has a still as the video asset and an audio track [ranging from 2 mins 30 duration to 8 mins with most at 3 mins 30 secs].
    Each menu has the same button structure, with three buttons.
    Button 1 points to a script that randomly plays each audio track once before returning to a main menu.
    Button 2 points to the main menu.
    Button 3 points to a Story which plays 1 chapter of video from the master asset [2.3 GB] then returns to the same menu. The master video has not been duplicated at all to do this, the story just points to the asset and then jumps back...
    THE CRUX OF THIS ISSUE IS that if I delete 1 or two of any combination of these two buttons, nothing really happens regarding a drop in file size in the Inspector or Disk Space Meter, BUT if I delete all three buttons, the file size drops from 448.3 MB to 12 MB, taking the Disk Meter from 5.5 GB to 5.0 GB!!!!
    This is obviously where my problem lies.
    ANYONE OUT THERE that can help it would be SOOOO GREATLY APPRECIATED!!!!!
    [HAL, are you there??? I'm sure you would have a solution].
    Thanks in advance.
    HMM.. here's a thought.... The Story that points to and plays 1 chapter of my main video before returning to the same menu would possibly be the same file size if exported and encoded separately.... Perhaps I have missed something with the Story navigation.....Unlikely though as is pretty straight forward [with the help of the manual of course].
    ALL HELP GREATLY APPRECIATED!!! THANKS..

  • Why does "Other" take so much space on iPad vs. iPod touch?

    When I plug the iPad into my iMac, I ownder why the Other category is so much larger than that for my Touch. The iPad is 32 GB, while the Touch is 16 GB. The are similary loaded with my music, photos and apps, but that Other thing is way much larger.
    Any thoughts?

    Found the answer in another thread. Went from 7.2 GB to 1.12 GB after restore and backup.

  • Firmware takes too much space any way to reduce it?

    when i updated the firmware i noticed i had less Mb in the 515 player is there any updated firmware that takes less space?
    why is there only 241Mb free if its a 256Mb storage thing? Tnx in advanced for ur answer

    I have never used any of MSI's MP3 players, but do they show up in my computer? If they do right click on the drive and go to properties. Down at the bottom it will show the capacity. As an example my 128MB USB flash drive show 130,019,328 bytes, but that equals 123MB. What does yours show?
    Also without any music on there how much space is used according to the property page?
    Good Luck
    Jeremy

  • Why does 14MB movie take 800MB of space on iPhone

    I noticed that when I select or deselect adding a 14MB video, the amount of free space changes by about 800MB. No more things are selected (apps, music, photos, etc.), just this one video. Here's a photo to prove it: http://img266.imageshack.us/img266/1074/w8ul.jpg
    So, how's that 14MB video takes 800MB of space?

    No, it's a 14MB .mp4 file.
    Also, I just remembered that the same thing happened when I selected "replace contacts with contacts from the computer", the change was about 500MB...
    BTW, I'm using Mac OS X Mavericks.

  • Why the 'LIKE' operator takes so much time to run?

    I have a table T with 3 columns and 3 indexes:
    CREATE TABLE T
    id VARCHAR2(38) NOT NULL,
    fid VARCHAR2(38) NOT NULL,
    val NVARCHAR2(2000) NOT NULL
    ALTER TABLE T ADD (CONSTRAINT pk_t PRIMARY KEY (id,fid));
    CREATE INDEX t_fid ON T(fid);
    CREATE INDEX t_val ON T(val);
    Then I have the following two queries which differ in only one place - the 1st one uses the '=' operator whereas the 2nd uses 'LIKE'. Both queries have the identical execution plan and return one identical row. However, the 1st query takes almost 0 second to execute, and the 2nd one takes more than 12 seconds, on a pretty beefy machine. I had played with the target text, like placing '%' here and/or there, and observed the similar timing every time.
    So I am wondering what I should change to make the 'LIKE' operator run as fast as the '=' operator. I know CONTEXT/CATALOG index is a viable approach, but I am just trying to find out if there is a simpler alternative, such as a better use of the index t_val.
    1) Query with '=' operator
    SELECT id
    FROM T
    WHERE fid = '{999AE6E4-1ED9-459B-9BB0-45C913668C8C}'
    AND val = '3504038055275883124';
    2) Query with 'LIKE' operator
    SELECT id
    FROM T
    WHERE fid = '{999AE6E4-1ED9-459B-9BB0-45C913668C8C}'
    AND val LIKE '3504038055275883124';
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=1 Card=1 Bytes=99)
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T' (Cost=1 Card=1 Bytes=99)
    2 1 INDEX (RANGE SCAN) OF 'T_VAL' (NON-UNIQUE) (Cost=4 Card=12)

    I will for sure try to change the order of the PK and see whether there will be any impact to the performance.
    In our application, val is much closer to a unique value than fid. In the example query, the execution plan showed that the index on val was indeed used in the execution of the query. That's why the 1st query took almost no time to return (our table T has more than 6 million rows).
    I was hoping the 'LIKE' operator would utilize the t_val index effectively and provide similar performance to the '=' operator. But apparently that's not the case, or needs some tricks.

  • Why is Preview taking up so much space on my hard drive when saving changes to a PDF file?

    I am working with a large PDF file (3.3GB) in Preview and am highlighting and adding notes to the contents. Every so often, Preview auto-saves the document, but while it's doing that it takes up a HUGE amount of space on my harddrive! Last time it tried, I went from having 4GB of space to 800MB and recieved a message saying I was almost out of disk space so I force closed the file. I am also pretty sure that I had closer to 15GB of space before I started using this file and since then it has dropped to only 3.3GB. Is there some sort of Preview cache? If so, how do I delete it?
    I've tried searching my harddrive for large files and didn't find anything larger than 1GB that I didn't recognize.

    read "more like this".

  • What is the "other" category and why is it taking up so much space?

    The "other" category on my iPod is taking up a considerable amount of space. I don't have very many apps, pictures, or videos because I want to preserve room for more music, but I can't seem to find a way to reduce the amount of memory that "other" takes up. Please help! Also, I would update to a newer system, but I don't have enough room.

    Everything else plus the operating system.

  • Why is Messaging taking up so much space?

    Messages is showing up under Usage as over 70 MB with almost all of it being saved messages. Is there a way to clear "cached" messages?

    Try reindexing Macintosh HD first.
    5. Re-index Macintosh HD.
        This will take a while. Wait until it is finished.
        System Preferences > Spotlight > Privacy
        http://support.apple.com/kb/ht2409

  • Ipad 3th gen photo sync problem take too much space / wrong color

    I am so happy after i got my 3th gen ipad i start sync 7k+ photo off my computer here problem i got and play phone tag with techsupport until now i still have this problems i wonder if anyone counter those and got tip to solve it.
    1. photo size in computer and ipad not match.
    my computer show 5 photo take 6mg
    i try a lot photo show in computer 386mg show in itune capacity 14.5gb i check in ipad do some + n - it take around 6.6gb
    i resize photo to so small it come out same problem
    2. photo color show not correct.
    most of my photo sync to my ipad show in green or purple color.
    I find out that any photo not in sRGB and do not have iccc color problem will have this problem i can be fix by convert it to sRGB and add iccc profile but it should not be this way ..
    the problem just with photo app that come with ipad, i test with adobe photo express it does the same problem color go all jack up.
    as now big big problem is can't seem to get photo sync correctly without 1 problem or other .. with 32Gb hdd i can't even get all photo that show 15gb in pc
    system
    win 7 home 64bit with latest itune 64bit
    ipad 3th gen 32gb with at&t 4glte

    I'm running iOS 5.1 on my iPhone4 and my new iPad3. But I never saw this color effect on my iPhone3G or iPod2G as well. I did sync some slideshows as well, but that is done on a Mac, not a Windows PC.
    What are the settings on your camera when you shoot the photos? Is the sRGB profile embedded by the camera? Any RAW formated pictures involved?

  • Why does last fetch take so much longer than first three?

    I have this trace file:
    EXEC #3:c=0,e=4803,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=2726503091,tim=2779072194357
    WAIT #3: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845769927079
    FETCH #3:c=0,e=2969,p=0,cr=56,cu=0,mis=0,r=1,dep=0,og=1,plh=2726503091,tim=2779072197438
    WAIT #3: nam='SQL*Net message from client' ela= 1006 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845769931224
    WAIT #3: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845769931269
    FETCH #3:c=0,e=322,p=0,cr=2,cu=0,mis=0,r=15,dep=0,og=1,plh=2726503091,tim=2779072198806
    WAIT #3: nam='SQL*Net message from client' ela= 3733 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845769935348
    WAIT #3: nam='SQL*Net message to client' ela= 0 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845769935423
    FETCH #3:c=0,e=178,p=0,cr=2,cu=0,mis=0,r=15,dep=0,og=1,plh=2726503091,tim=2779072202692
    WAIT #3: nam='SQL*Net message from client' ela= 3136 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845769938725
    WAIT #3: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845769938763
    FETCH #3:c=410000,e=403256,p=0,cr=7354,cu=0,mis=0,r=13,dep=0,og=1,plh=2726503091,tim=2779072609065
    STAT #3 id=1 cnt=44 pid=0 pos=1 obj=0 op='PARTITION RANGE SINGLE PARTITION: KEY KEY (cr=7414 pr=0 pw=0 time=0 us cost=7 size=9823 card=47)'
    STAT #3 id=2 cnt=44 pid=1 pos=1 obj=0 op='PARTITION RANGE SINGLE PARTITION:   (cr=7414 pr=0 pw=0 time=0 us cost=7 size=9823 card=47)'
    STAT #3 id=3 cnt=44 pid=2 pos=1 obj=590979 op='TABLE ACCESS BY LOCAL INDEX ROWID BA_PGM_SLS_DTL PARTITION: KEY KEY (cr=7414 pr=0 pw=0 time=0 us cost=7 size=9823 card=47)'
    STAT #3 id=4 cnt=44 pid=3 pos=1 obj=590982 op='INDEX RANGE SCAN BA_PGM_SLS_DTL_PK PARTITION: KEY KEY (cr=7408 pr=0 pw=0 time=10 us cost=6 size=0 card=1)'
    WAIT #3: nam='SQL*Net message from client' ela= 3104 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=2845770355048It looks to me like the first three fetches return 31 rows in very little time, but the last fetch takes about .4 seconds and does about 7354 buffer gets to get the remaining 13 rows. Does anyone have an idea what might cause this?
    - Bobby

    I goofed. The types of two of the bind variables got reversed:
    Wrong type
    VARIABLE V_PRIM_CUST_CNTL_LOCN VARCHAR2(10)
    VARIABLE V_PRIM_CUST_NBR NUMBER
    Right type
    VARIABLE V_PRIM_CUST_CNTL_LOCN NUMBER
    VARIABLE V_PRIM_CUST_NBR VARCHAR2(10)
    Once I fixed this the query reads hardly any blocks at all just as I would expect. I guess the first three fetches got lucky and hit some blocks with matching data. The last fetch must have read through a bunch of index blocks needlessly because it wasn't using all the values in the where clause.
    Here are the predicates with the right plan and wrong:
    good
       4 - access("BPSD"."PGM_MSTR_NBR"=:V_PGM_MSTR_NBR AND "BPSD"."PGM_SEQ"=:V_PGM_SEQ AND
                  "BPSD"."PMT_STS"=:V_PMT_STS AND "BPSD"."PRIM_CUST_CNTL_LOCN"=:V_PRIM_CUST_CNTL_LOCN AND
                  "BPSD"."PRIM_CUST_NBR"=:V_PRIM_CUST_NBR AND "BPSD"."DIV_NBR"=:V_DIV_NBR AND
                  "BPSD"."CUST_CNTL_LOCN"=:V_CUST_CNTL_LOCN AND "BPSD"."CUST_NBR"=:V_CUST_NBR AND
                  "BPSD"."PRCS_DT"=TO_DATE(:V_PRCS_DT,'DD-MON-YYYY') AND "BPSD"."CR_MEMO_NBR"=:V_CR_MEMO_NBR AND
                  "BPSD"."INV_NBR"=:V_INV_NBR)
    bad
       4 - access("BPSD"."PGM_MSTR_NBR"=:V_PGM_MSTR_NBR AND "BPSD"."PGM_SEQ"=:V_PGM_SEQ AND
                  "BPSD"."PMT_STS"=:V_PMT_STS AND "BPSD"."PRIM_CUST_CNTL_LOCN"=TO_NUMBER(:V_PRIM_CUST_CNTL_LOCN) AND
                  "BPSD"."DIV_NBR"=:V_DIV_NBR AND "BPSD"."CUST_CNTL_LOCN"=:V_CUST_CNTL_LOCN AND "BPSD"."CUST_NBR"=:V_CUST_NBR AND
                  "BPSD"."PRCS_DT"=TO_DATE(:V_PRCS_DT,'DD-MON-YYYY') AND "BPSD"."CR_MEMO_NBR"=:V_CR_MEMO_NBR AND
                  "BPSD"."INV_NBR"=:V_INV_NBR)
           filter(("BPSD"."INV_NBR"=:V_INV_NBR AND "BPSD"."CUST_NBR"=:V_CUST_NBR AND
                  TO_NUMBER("BPSD"."PRIM_CUST_NBR")=:V_PRIM_CUST_NBR AND "BPSD"."DIV_NBR"=:V_DIV_NBR AND
                  "BPSD"."CR_MEMO_NBR"=:V_CR_MEMO_NBR AND "BPSD"."PRCS_DT"=TO_DATE(:V_PRCS_DT,'DD-MON-YYYY') AND
                  "BPSD"."CUST_CNTL_LOCN"=:V_CUST_CNTL_LOCN))Having reviewed this I believe this is what Jonathan Lewis meant by a hidden coercion of the data type of one of the columns. The column PRIM_CUST_NBR had to be converted to a number to compare it with the mistyped bind variable and so none of the columns after that one in the index could be used in the range scan.
    - Bobby
    Edited by: Bobby Durrett on Jul 9, 2012 3:17 PM
    Edited by: Bobby Durrett on Jul 10, 2012 8:23 PM

Maybe you are looking for