You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Steven Prentice <st...@gmail.com> on 2010/08/04 01:31:46 UTC

VIEW Performance Testing Help

Hey Couchinators!

My friend and I are trying to test the impact that views have on the size of
the database and have a few questions...

1. if the value of a view is set to 'doc' does that mean that the leaves of
the view B-Tree are now documents or are they simply pointers to the
document leaves in the database B-Tree?
i.e would the summed memory of all of the values in the view be equal to the
size of the database (ignoreing revisions)?

2. also we would like to know if the database size that is displayed in
futon includes the size of the views?

3. Oh also, Revisions...is a revision an entire document or does a revision
only track changes in a document?

Cheers
Steve + Adam

Re: VIEW Performance Testing Help

Posted by Steven Prentice <st...@gmail.com>.
On Wed, Aug 4, 2010 at 12:07 PM, Steven Prentice <
steven.prentice.87@gmail.com> wrote:

>
>
> ---------- Forwarded message ----------
> From: Paul Joseph Davis <pa...@gmail.com>
> Date: Wed, Aug 4, 2010 at 11:58 AM
> Subject: Re: VIEW Performance Testing Help
> To: "user@couchdb.apache.org" <us...@couchdb.apache.org>
>
>
>
>
>
>
> On Aug 3, 2010, at 7:31 PM, Steven Prentice <st...@gmail.com>
> wrote:
>
> > Hey Couchinators!
> >
> > My friend and I are trying to test the impact that views have on the size
> of
> > the database and have a few questions...
> >
> > 1. if the value of a view is set to 'doc' does that mean that the leaves
> of
> > the view B-Tree are now documents or are they simply pointers to the
> > document leaves in the database B-Tree?
> > i.e would the summed memory of all of the values in the view be equal to
> the
> > size of the database (ignoreing revisions)?
>
> Whatever you emit as a value is stored  in the btree. So if you emit an
> entire document it is stored completely in that view. A way to avoid this is
> to use the include_docs=true parameter but it has some read performance
> trade offs because it's a lookup per view row. The best idea is to only emit
> what's actually needed.
>
>
> > 2. also we would like to know if the database size that is displayed in
> > futon includes the size of the views?
>
> Unless I missed that commit, no, db size is the size of just the .couch
> file.
>
> > 3. Oh also, Revisions...is a revision an entire document or does a
> revision
> > only track changes in a document?
>
> Neither. A revision is just the string-id pair (More precisely it's a node
> in the revision tree, but it still has zero info on actual document
> content). That's all that will remain on disk after a compaction. Because
> we're tail append the previous entire documents remain on disk until
> compaction. To illustrate, we've had discussions on removing access to old
> revisions and renaming revision to something else that doesn't make people
> think they'll always have access to old versions of a document.
>
> > Cheers
> > Steve + Adam
>
> HTH,
> Paul Davis
>
> How would we check how much space that just the views are taking up?
cheers!

Re: VIEW Performance Testing Help

Posted by Paul Joseph Davis <pa...@gmail.com>.



On Aug 3, 2010, at 7:31 PM, Steven Prentice <st...@gmail.com> wrote:

> Hey Couchinators!
> 
> My friend and I are trying to test the impact that views have on the size of
> the database and have a few questions...
> 
> 1. if the value of a view is set to 'doc' does that mean that the leaves of
> the view B-Tree are now documents or are they simply pointers to the
> document leaves in the database B-Tree?
> i.e would the summed memory of all of the values in the view be equal to the
> size of the database (ignoreing revisions)?

Whatever you emit as a value is stored  in the btree. So if you emit an entire document it is stored completely in that view. A way to avoid this is to use the include_docs=true parameter but it has some read performance trade offs because it's a lookup per view row. The best idea is to only emit what's actually needed. 


> 2. also we would like to know if the database size that is displayed in
> futon includes the size of the views?

Unless I missed that commit, no, db size is the size of just the .couch file. 

> 3. Oh also, Revisions...is a revision an entire document or does a revision
> only track changes in a document?

Neither. A revision is just the string-id pair (More precisely it's a node in the revision tree, but it still has zero info on actual document content). That's all that will remain on disk after a compaction. Because we're tail append the previous entire documents remain on disk until compaction. To illustrate, we've had discussions on removing access to old revisions and renaming revision to something else that doesn't make people think they'll always have access to old versions of a document. 

> Cheers
> Steve + Adam

HTH,
Paul Davis