88_local.mql 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. delete 性能备份AaB from /test/性能AaB_Local with version
  2. /**
  3. onerror(continue,`not exist`,`not find`,`not found`)
  4. **/
  5. ;
  6. delete 性能AaB from /test/性能AaB_Local with version
  7. /**
  8. onerror(continue,`not exist`,`not find`,`not found`)
  9. **/
  10. ;
  11. delete from /test/性能AaB_Local with version
  12. /**
  13. onerror(continue,`not exist`,`not find`,`not found`)
  14. **/
  15. ;
  16. drop class if exists /test/性能AaB_Local;
  17. create class if not exists /test/性能AaB_Local (
  18. 主机AaB varchar,
  19. v_date date,
  20. v_timestamp timestamp,
  21. 性能备份AaB bucket {
  22. "dict": true,
  23. "slot": 5,
  24. "ttl": 2,
  25. "type": "promdb",
  26. "version": 1
  27. },
  28. noindex varchar,
  29. 性能AaB bucket {
  30. "dict": true,
  31. "slot": 5,
  32. "ttl": 2,
  33. "type": "promdb",
  34. "version": 1
  35. },
  36. keys(主机AaB),
  37. indexes(主机AaB )
  38. )with core=local, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_Local'
  39. ;
  40. insert into /test/性能AaB_Local (id,主机AaB,v_date,v_timestamp) values ('性能AaB_Local:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
  41. insert into /test/性能AaB_Local (id,主机AaB,v_date,v_timestamp) values ('性能AaB_Local:test2',"服务器2","1754-08-31","1754-08-31 15:55:55");
  42. select * from /test/性能AaB_Local where v_date='1754-08-31' refresh
  43. /**
  44. output()
  45. count(1)
  46. **/
  47. ;
  48. select * from /test/性能AaB_Local where v_timestamp='1754-08-31 15:55:55' refresh
  49. /**
  50. output()
  51. count(1)
  52. **/
  53. ;
  54. create ("性能AaB_Local:test")-[:connect]->("性能AaB_Local:test2")
  55. /**
  56. output()
  57. **/
  58. ;
  59. create ("性能AaB_Local:test2")-[:connect]->("性能AaB_Local:test")
  60. /**
  61. output()
  62. **/
  63. ;
  64. match ("性能AaB_Local:test")-[:connect]->("性能AaB_Local:test2")
  65. /**
  66. match("graph.nodes.len",2)
  67. **/
  68. ;
  69. select connect from /test/性能AaB_Local
  70. /**
  71. output()
  72. matchcount("connect",{"_all":["性能AaB_Local:test"]},1)
  73. matchcount("connect",{"_all":["性能AaB_Local:test2"]},1)
  74. **/
  75. ;
  76. select count(*) from /test/性能AaB_Local where 主机AaB='服务器1'
  77. /**
  78. output()
  79. count(1)
  80. **/
  81. ;
  82. cql: select * from field where namespace='test' and name in ('主机aab','noindex')
  83. /**
  84. match("name", "主机aab", "isindex", 1)
  85. match("name", "noindex", "isindex", 0)
  86. **/
  87. ;
  88. select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10
  89. /**
  90. output()
  91. count(1)
  92. **/
  93. ;
  94. select "hello".id from /test/性能AaB_Local "hello" where v_date between 1774972800000 and 1776182400000 order by "hello".v_date limit 10
  95. /**
  96. output()
  97. count(1)
  98. **/
  99. ;
  100. select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10
  101. /**
  102. output()
  103. count(1)
  104. **/
  105. ;
  106. {"sql":"select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10"}
  107. /**
  108. output()
  109. count(1)
  110. **/
  111. ;
  112. {"sql":"select \"order\".id from /test/性能AaB_Local \"order\" where \"order\".v_date between 1774972800000 and 1776182400000 limit 10"}
  113. /**
  114. output()
  115. count(1)
  116. **/
  117. ;
  118. {"sql":"select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10"}
  119. /**
  120. output()
  121. count(1)
  122. **/
  123. ;