I use Couchbase 6.5.1 and currently evaluating a case for our application.
I created a bucket with 50M of small documents (JSON with the long numbers), all documents have the same schema. The bucket takes approx 5GB of disk space. It took just a few mins to load all the records. So far so good.
Then I created a secondary GSI index on one of the fields (to be able to select documents with property “ciid” equal to some value) with command
The creation of the index took approx 4hours and consumed 135GB of space. Why the index build takes so long and why it consumed so much disk space? How can I avoid it or what did I do wrong? I’d expect to be much quicker and the disk space would be a lot less - the index is 27times larger than the primary data, how is that possible?
After a compation it dropped to 12GB which is still 2 times bigger than original data, however it’s manageable.
Can you help me and show me some direction, please?