title: Azure Cosmos DB partitioning and Indexing of Data in SQL API using PATH
body: <p>I am collecting IoT data to Azure cosmos DB. I know COSOMOS DB SQL API is auto indexed by Path. I have around 150 sensors in each document, and most of sql queries are of </p>
  
  <p><strong>DeviceId is already Partition Key</strong> </p>
  
  <blockquote>
    <p>Select c.sensorVariable  From c where c.DeviceId = 'dev1' AND c.time= date1'</p>
    
    <p>{ "DeviceId" : 'dev1' , "time" : 123333 , "sensor1" : 20 , "sensor2" : 40}</p>
  </blockquote>
  
  <p>I will Fetch the various sensors data but all my queries are depend on depend on deviceId and time( which is in Unix Timestamp ) </p>
  
  <p>Is it possible to index data on deviceID and time and exclude other keys, which are also in the same path / .</p>
  
  <p>And for collection by default </p>
  
  <pre><code>"includedPaths": [
      {
          "path": "/*",
          "indexes": [
              {
                  "kind": "Range",
                  "dataType": "Number",
                  "precision": -1
              },
              {
                  "kind": "Range",
                  "dataType": "String",
                  "precision": -1
              },
              {
                  "kind": "Spatial",
                  "dataType": "Point"
              }
          ]
      }
  ],
  </code></pre>
  
  <p>It comes with this I feel as for DataType String shouldn't it be having Hash kind indexing rather than Range? And what is this <strong>Precision : -1</strong> </p>
  
  <p>In Azure cosmos DB doc examples I have seen precision as 3 for string, I did not understood why ? </p>
  
  <p>If I have 100 devices and putting data every second level what type of indexing is better ? </p>