88_local.mql 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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*1..1]->("性能AaB_Local:test2")
  65. /**
  66. match("graph.nodes.len",2)
  67. **/
  68. ;
  69. match ("性能AaB_Local:test")-[:connect]->("性能AaB_Local:test2")
  70. /**
  71. match("graph.nodes.len",2)
  72. **/
  73. ;
  74. match ("性能AaB_Local:test")-[*]->("性能AaB_Local:test2")
  75. /**
  76. match("graph.nodes.len",2)
  77. **/
  78. ;
  79. select connect from /test/性能AaB_Local
  80. /**
  81. output()
  82. matchcount("connect",{"_all":["性能AaB_Local:test"]},1)
  83. matchcount("connect",{"_all":["性能AaB_Local:test2"]},1)
  84. **/
  85. ;
  86. select count(*) from /test/性能AaB_Local where 主机AaB='服务器1'
  87. /**
  88. output()
  89. count(1)
  90. **/
  91. ;
  92. cql: select * from field where namespace='test' and name in ('主机aab','noindex')
  93. /**
  94. match("name", "主机aab", "isindex", 1)
  95. match("name", "noindex", "isindex", 0)
  96. **/
  97. ;
  98. select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10
  99. /**
  100. output()
  101. count(1)
  102. **/
  103. ;
  104. select "hello".id from /test/性能AaB_Local "hello" where v_date between 1774972800000 and 1776182400000 order by "hello".v_date limit 10
  105. /**
  106. output()
  107. count(1)
  108. **/
  109. ;
  110. select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10
  111. /**
  112. output()
  113. count(1)
  114. **/
  115. ;
  116. {"sql":"select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10"}
  117. /**
  118. output()
  119. count(1)
  120. **/
  121. ;
  122. {"sql":"select \"order\".id from /test/性能AaB_Local \"order\" where \"order\".v_date between 1774972800000 and 1776182400000 limit 10"}
  123. /**
  124. output()
  125. count(1)
  126. **/
  127. ;
  128. {"sql":"select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10"}
  129. /**
  130. output()
  131. count(1)
  132. **/
  133. ;