On Mon, Aug 13, 2012 at 11:26 AM, Michael Hampicke <mgehampicke@gmail.com> wrote:
Am 13.08.2012 16:52, schrieb Michael Mol:
> On Mon, Aug 13, 2012 at 10:42 AM, Michael Hampicke <mgehampicke@gmail.com>wrote:
>
>> Have you indexed your ext4 partition?
>>>
>>> # tune2fs -O dir_index /dev/your_partition
>>> # e2fsck -D /dev/your_partition
>>>
>> Hi, the dir_index is active. I guess that's why delete operations take as
>> long as they take (index has to be updated every time)
>>
>
> 1) Scan for files to remove
> 2) disable index
> 3) Remove files
> 4) enable index
>
> ?
>

That's what I love about gentoo-users :) , I would never have thought of
that myself. I will try this and see how much of an performance gain
there is. Disabling the index should only require a 'mount -o remount' I
guess.


It's the same logic as behind database programming; do a bulk modification, then update the index afterwards. The index update will take longer than that for a single file, but it has the potential to be more efficient in bulk operations. (It'd be nice if ext4 supported transactional behaviors, where you could defer index updates until after a commit, but I don't think it (or any filesystem on Linux) does.)

You *should* be able to enable/disable indexes on a per-directory basis, so if your search pattern is confined, I'd go that route.



--
:wq