directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <akaras...@nextury.com>
Subject Re: Performance issue when deleting entries
Date Tue, 12 May 2009 23:34:50 GMT
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 !!!

FYI: We should keep things like this on the dev ML.

-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org

Mime
View raw message