couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kocoloski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-92) Have compaction work on view indexes
Date Thu, 26 Feb 2009 18:15:02 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677080#action_12677080
] 

Adam Kocoloski commented on COUCHDB-92:
---------------------------------------

Hi, I took a shot at compacting views this week.  Initial results look promising.  I took
the simpler approach of letting the compaction recompute the reductions.  I also let the MapReduce
view updater take care of the situation where the compacted view is still behind the main
view due to documents being updated during compaction.  The draft API is

HTTP
POST /dbname/_compact/groupname => 202 {"ok":true}

Erlang
couch_view_compactor:start_compact(<<"dbname">>, <<"_design/groupname">>)
-> ok

Code is available on GitHub at
http://github.com/kocolosk/couchdb/tree/jira-92

Cheers, Adam

> Have compaction work on view indexes
> ------------------------------------
>
>                 Key: COUCHDB-92
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-92
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.8
>            Reporter: Jan Lehnardt
>             Fix For: 0.9
>
>
> Right now, view indexes just grow and grow with each new index update. Since they are
just indexes, and not the data itself, compaction is simply a matter of deleting the index
files.
> Also, the current Btree implementation isn't completely self balanacing. It misses a
balancing condition, partially for efficiency (it's an expensive balancing operation), and
for expediency. It was easier to not implement it and gets the general case perormance boost.
> The thing about this is, the btree code can remain as is if the indexing compaction just
recopies the map values (and back indexes) and recomputes the reduction values. That's a very
simple design, however, if the btree is completely self balancing, then the btree can be copied
on a node by node basis, instead of a value by value basis, and the reduction values need
not be recomputed all. This will make the compaction significantly faster overall.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message