88_local.mql 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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, v_date, v_timestamp )
  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","1901-08-31 15:55:55");
  42. insert into /test/性能AaB_Local (id,主机AaB,v_date,v_timestamp) values ('性能AaB_Local:test3',"*服务器2?",1775059200000,"2026-04-02 15:55:55");
  43. insert into /test/性能AaB_Local (id,day,vtime,主机AaB,v_date,v_timestamp) values ('性能AaB_Local:test4',"2026-04-02","2026-04-02 15:55:55", "*服务器2?",1775059200000,"2026-04-02 15:55:55");
  44. select * from /test/性能AaB_Local where v_date=1775059200000 refresh
  45. /**
  46. output()
  47. count(3)
  48. **/
  49. ;
  50. select * from /test/性能AaB_Local where day=1775059200000 refresh
  51. /**
  52. output()
  53. count(1)
  54. **/
  55. ;
  56. select * from /test/性能AaB_Local where v_date='2026-04-02' refresh
  57. /**
  58. output()
  59. count(3)
  60. **/
  61. ;
  62. select * from /test/性能AaB_Local where day='2026-04-02' refresh
  63. /**
  64. output()
  65. count(1)
  66. **/
  67. ;
  68. select * from /test/性能AaB_Local where v_date='1754-08-31' refresh
  69. /**
  70. output()
  71. count(1)
  72. **/
  73. ;
  74. select * from /test/性能AaB_Local where v_timestamp='1901-08-31 15:55:55' refresh
  75. /**
  76. output()
  77. count(1)
  78. **/
  79. ;
  80. create ("性能AaB_Local:test")-[:connect]->("性能AaB_Local:test2")
  81. /**
  82. output()
  83. **/
  84. ;
  85. create ("性能AaB_Local:test2")-[:connect]->("性能AaB_Local:test")
  86. /**
  87. output()
  88. **/
  89. ;
  90. match ("性能AaB_Local:test")-[:connect*1..1]->("性能AaB_Local:test2")
  91. /**
  92. match("graph.nodes.len",2)
  93. **/
  94. ;
  95. match ("性能AaB_Local:test")-[:connect]->("性能AaB_Local:test2")
  96. /**
  97. match("graph.nodes.len",2)
  98. **/
  99. ;
  100. --match ("性能AaB_Local:test")-[*]->("性能AaB_Local:test2")
  101. /**
  102. --match("graph.nodes.len",2)
  103. **/
  104. ;
  105. select connect from /test/性能AaB_Local
  106. /**
  107. output()
  108. matchcount("connect",{"_all":["性能AaB_Local:test"]},1)
  109. matchcount("connect",{"_all":["性能AaB_Local:test2"]},1)
  110. **/
  111. ;
  112. select count(*) from /test/性能AaB_Local where 主机AaB='[服务器1]'
  113. /**
  114. output()
  115. count(1)
  116. **/
  117. ;
  118. sql: select count(*) from /test/性能AaB_Local where 主机AaB='*服务器2?'
  119. /**
  120. output()
  121. count(1)
  122. **/
  123. ;
  124. cql: select * from field where namespace='test' and name in ('主机aab','noindex')
  125. /**
  126. match("name", "主机aab", "isindex", 1)
  127. match("name", "noindex", "isindex", 0)
  128. **/
  129. ;
  130. select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10
  131. /**
  132. output()
  133. count(3)
  134. **/
  135. ;
  136. select "hello".id from /test/性能AaB_Local "hello" where v_date between 1774972800000 and 1776182400000 order by "hello".v_date limit 10
  137. /**
  138. output()
  139. count(3)
  140. **/
  141. ;
  142. select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10
  143. /**
  144. output()
  145. count(3)
  146. **/
  147. ;
  148. {"sql":"select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10"}
  149. /**
  150. output()
  151. count(3)
  152. **/
  153. ;
  154. {"sql":"select \"order\".id from /test/性能AaB_Local \"order\" where \"order\".v_date between 1774972800000 and 1776182400000 limit 10"}
  155. /**
  156. output()
  157. count(3)
  158. **/
  159. ;
  160. {"sql":"select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10"}
  161. /**
  162. output()
  163. count(3)
  164. **/
  165. ;