Hi,
I have created the below INDEX
CREATE INDEX assets
ON assets
(status
,type
,created_on
DESC)
For the following DOCUMENT
{
"created_on": 1507299722,
"modified_on": 1507299722,
"eloc": "TTBT76",
"type": "atlas",
"source": 101,
"asset_name": "43b174f6cbc818fb.jpg",
"user_id": "38c345d166882c68d7029bb0960752c5",
"status": 1,
"pin_id": "4c032de3989b4b20015d3f109118518b"
}
When I run SELECT asset_name,created_on, eloc FROM assets WHERE status=0 AND type=‘review’ ORDER BY created_on DESC LIMIT 10;
The query takes 10ms which I expect from the query but when I run SELECT asset_name,created_on, eloc FROM assets WHERE status IS NOT MISSING AND type IS NOT MISSING ORDER BY created_on DESC LIMIT 10;
The query takes more than 2 seconds. Am I missing something and what is the correct way to achieve a faster result?
I always follow https://blog.couchbase.com/create-right-index-get-right-performance/ article for creating INDEXES.