couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: Database-level statistics/on-disk file names
Date Sun, 19 Sep 2010 12:27:53 GMT

On 17 Sep 2010, at 10:10, Dirkjan Ochtman wrote:

> Hi there,
> 
> I'd like to be able to determine how much disk space the index for a
> certain ddoc takes. Is there any easy way of doing that?

 curl $COUCH/db/_design/name/_info
{"name":"db","view_index":{"signature":"431517a0e7decdaa8a97d0dc9ffd7412","language":"javascript","disk_size":51,"updater_running":true,"compact_running":false,"waiting_commit":false,"waiting_clients":0,"update_seq":0,"purge_seq":0}}

The `signature` field corresponds to the .db_design/`signature`.view file.

--

> Relatedly, would it be possible to rejigger the on-disk layout a
> little bit to make the filenames easier to understand? For example, we
> now have:
> 
> /foo.couch
> /.foo_design/<big-hash>.view
> /.foo_temp
> 
> It would seem nicer to have, e.g.
> 
> /foo/data.couch
> /foo/users-<big-hash>.view
> /foo/.temp

I understand that it may seem nice to have everything related to a 
databases in a single directory, for say moving things around but 
practically, the current format is just as easy to script as the proposed 
version. What other reasons do you see that would improve with 
the proposed version?

In addition, creating and deleting databases would no longer be 
atomic (mkdir & fopen), but I'm not sure that's a hard requirement. 
I know the current model includes some very finicky details about 
deleting and renaming files on Windows which would need to be 
taken into consideration when changing the filesystem structure.

> (Unless maybe you want to be able to rename design docs without having
> to re-index, but I think even that would be manageable.)

This is a required feature :)

> This would also make index size fairly transparent.

I don't see how that's any different with either or any filesystem layout.

> Semi-relatedly, has anyone taken a swing at reflecting /_stats into a
> Futon page?

Oh I'd *love* to see that :)

Cheers
Jan
-- 


Mime
View raw message