2

I have created an index, but explain sql does not use the index. I have ensured that GridDB has up-to-date statistics by running the available commands and index on (DeviceId, Property) is in the correct order.

griddb 5.1.0

gs[public]> explain analyze select * from properties_test where deviceId='101' and property='0' limit 0,10;
The query had been executed. (60,662 ms)
gs[public]> getplantxt
Id Type     Input Rows Lead time Actual time Node               And more..                         
---------------------------------------------------------------------------------------------------
 0 SCAN     -     -        60597       48739 192.168.1.62:10001 table: {properties_test} LIMIT: 10
 1   RESULT 0     10           0           0 192.168.1.62:20001                                   
gs[public]> showcontainer properties_test
Database    : public
Name        : properties_test
Type        : COLLECTION
Partition ID: 13
DataAffinity: -

Columns: No Name Type CSTR RowKey


0 Type STRING
1 DeviceId STRING
2 Property STRING
3 Id STRING
4 NumberValue DOUBLE
5 Value STRING
6 CreateTime TIMESTAMP
7 Timestamp TIMESTAMP

Indexes: Name : Type : TREE Columns: No Name


0 Property

Name : Type : TREE Columns: No Name


0 DeviceId

Name : Type : TREE Columns: No Name


0 Timestamp

Name : Type : TREE Columns: No Name


0 DeviceId 1 Property

0 Answers0