View Index on all bucket documents => bad idea?


In a sql database you can query the db dictionary to get some info on each table => number of records in each table.

To know how many docs per doc_type, we could create following view:

function (doc, meta) {
if (doc.doc_type) {
emit(doc.doc_type, null);

Now this index is on all docs, is this a very bad idea?

Instead of all-in-one view:

We could create a view on each doc_type for which we want to retrieve the number of docs.

Your advice would be appreciated.