88_local.mql 3.0 KB

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