[COMPASS-3036] Unresponsive "Documents" view for data with big arrays Created: 01/Aug/18  Updated: 29/Oct/23  Resolved: 15/Nov/18

Status: Closed
Project: Compass
Component/s: Compass
Affects Version/s: 1.15.0
Fix Version/s: 1.17.0

Type: Bug Priority: Major - P3
Reporter: Vlad Banishevskii Assignee: Durran Jordan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: COMPASS-1739
Sprint: Iteration Naan, Iteration Octopus, Iteration Paneer, Iteration Qbert, Iteration Ratatouille, Iteration Sriracha

 Description   

When trying to view the data on a collection which has documents with big arrays in it, the compass UI gets completely unresponsive. The same problem is encountered in Aggregations tab as well.

The problem is common for most of IoT projects, it's not unusual to see such documents there. 

Below the script to simulate the issue:

const DATA_SIZE  = 60 * 60 * 12 // every second for 12 hours
const adjectives = 'autumn hidden smiling bitter misty'.split(' ')
const nouns      = 'waterfall river carefully breeze moon rain'.split(' ')
 
const getRandomNumber = limit => (Math.random() * limit).toFixed(4) * 1
 
function insertData(left, right, coll) {
    print(`inserting: ${left}-${right} `)
    coll.insert({
        serverName : `${left}-${right}`,
        hostName   : `${left}${right}.local`,
        eventName  : right,
        data       : generateRandomData(DATA_SIZE)
    })
}
 
function generateRandomData(size) {
    var temp = []
    for(let i = 0; i < size; i++ ) {
        temp.push({
            ts : new Date().getTime() + i,
            v  : i + getRandomNumber(1000)
        })
    }
    return temp
}
 
function populateCollection(coll) {
    coll.drop()
    coll.createIndex({serverName: 1, eventName: 1})
    adjectives.forEach(adj => nouns.forEach(noun => insertData(adj, noun, coll)))
}
 
populateCollection(db.iot)
 
print('Enjoy!')

 


Generated at Wed Feb 07 22:31:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.