88.mql 2.7 KB

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