Couchbase N1QL Query for Index Size

Hi all,

From this post, “select * from system:indexes” does not show index size:

This was back in April 2017, and I just tried it on CB 4.6.2 (Linux), and it’s still not there. I guess there wasn’t an enhancement filed. Is the size of each index available anywhere else? I’m trying to create a monitoring toolset (scripts) to monitor the index growth while we determine sizing and which indexes to use. I understand we can use the Couchbase Console for the metrics, and potentially the data can be pulled from cbstats as well (not sure… I would think so…)

From this post, there is a utility (but no support for production):

I would definitely prefer a N1QL query or even something that can be accessible via a REST HTTP call to get the information in a dev/test/prod environment. Any idea? :slight_smile:

Thank you.
Regards, Steve

Hi @scheok,

I created a feature request ticket (MB-26198). That’s no guarantee that it will get prioritized, of course.

Would you mind expanding on why you want this information? Having some motivation information in the ticket might be helpful to the product managers/engineers.

Hi again @schoek,

It looks like there’s already a feature request to expose index stats via REST: so you might want to keep an eye on that one.

Thank you @matthew.groves.

Thanks for filing MB-26198 and pointing out that MB-23000 might also have the feature as well.

Having these metrics that can be queried (N1QL or REST) can allow us to integrate our monitoring solution to query information on-demand or scheduled.

I’m also looking at cbstats, but it doesn’t seem that it has index information. Using cbstats would require the ability to run cbstats (e.g., in a script to parse out the information needed). Therefore, something that can be queried directly (e.g., N1QL or REST) would be more ideal.