我正在使用Azure SQL API,并且我的数据以以下方式构造:
{
"deviceId": "123_123",
"comms": 0,
"engineSpdEnc": 0,
"currentTime": 1542185998605,
"deviceName": "mydevice2",
"siteId": 0,
"messageType": 2,
"data": {
"v5B3Freq": 0,
"v5B3Amp": 0,
"v5B4Freq": 0,
"v5B4Amp": 0,
"v5B5Freq": 0,
"v5B5Amp": 0,
"v6B6Freq": 0,
"v6B6Amp": 0,
"v6B7Freq": 0,
"v6B7Amp": 0,
"inletPres": 0
},
"EventProcessedUtcTime": "2018-11-14T09:01:42.6897624Z",
"PartitionId": 1,
"EventEnqueuedUtcTime": "2018-11-14T08:59:58.645Z",
"IoTHub": {
"MessageId": null,
"CorrelationId": null,
"ConnectionDeviceId": "device1",
"ConnectionDeviceGenerationId": "636758197942626855",
"EnqueuedTime": "2018-11-14T08:59:58.649Z",
"StreamId": null
},
"id": "1734dd0c-1bb5-d424-4946-e2c957bb3858",
"_rid": "lblPAOEu3xYCAAAAAAAAAA==",
"_self": "dbs/lblPAA==/colls/lblPAOEu3xY=/docs/lblPAOEu3xYCAAAAAAAAAA==/",
"_etag": "\"08008e15-0000-0000-0000-5bebe47c0000\"",
"_attachments": "attachments/",
"_ts": 1542186108 }
通过使用Azure门户,我已将索引策略从默认更改为以下内容:
{
"indexingMode": "lazy",
"automatic": false,
"includedPaths": [
{
"path": "/*",
"indexes": [
{
"kind": "Range",
"dataType": "Number",
"precision": 3
},
{
"kind": "Range",
"dataType": "String",
"precision": 3
},
{
"kind": "Spatial",
"dataType": "Point"
}
]
}
],
"excludedPaths": [
{
"path": "/data/*"
}
]
}
因此,我禁用了自动索引策略,并排除了/data/*
中的路径,这意味着
如果我要查询:
select * from c where c.data.v6B7Amp = 0
由于c.data.pressure
没有索引,它应该什么也不会返回,但是我得到的所有记录都应该在其中。
是因为我正在使用Azure门户更改索引还是其他任何东西?