directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: Performance issue when deleting entries
Date Wed, 13 May 2009 06:25:29 GMT
Alex Karasulu wrote:
> On Tue, May 12, 2009 at 2:23 PM, Kiran Ayyagari wrote:
>
>   
>> Hi Emmanuel,
>>
>> The below fix would avoid building of a global cursor on a table and moving
>> it to appropriate position and at the same time avoiding iterating on all
>> the values.
>>
>>
>>  Index:
>> src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
>> ===================================================================
>> ---
>> src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
>> (revision 766843)
>> +++
>> src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
>> (working copy)
>> @@ -475,9 +475,8 @@
>>       */
>>      public void drop( Long id ) throws Exception
>>      {
>> -        Cursor<Tuple<Long,K>> values = reverse.cursor();
>> +        Cursor<Tuple<Long,K>> values = reverse.cursor( id );
>>          Tuple<Long,K> tuple = new Tuple<Long,K>( id, null );
>> -        values.before( tuple );
>>
>>          while ( values.next() )
>>          {
>>
>>
>> P.S :- thanks to Seelmann and Emmanuel without their identification of
>> problem and
>>          fix I wouldn't have got this idea.
>>
>>     
>
> That's an elegant fix !!!
>   

I applied it yesturday.

I will create a JIRA in order to have it in the release note.

-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message