77reclass.mql 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. delete 性能备份AaB from /tmpp/性能AaB2 with version
  2. /**
  3. onerror(continue,`not exist`,`not find`,`not found`)
  4. **/
  5. ;
  6. delete 性能AaB from /tmpp/性能AaB2 with version
  7. /**
  8. onerror(continue,`not exist`,`not find`,`not found`)
  9. **/
  10. ;
  11. delete from /tmpp/性能AaB2 with version
  12. /**
  13. onerror(continue,`not exist`,`not find`,`not found`)
  14. sleep(3s)
  15. **/
  16. ;
  17. drop class if exists /tmpp/性能AaB2
  18. /**
  19. output()
  20. onerror(continue,`not exist`,`not find`,`not found`)
  21. sleep(3s)
  22. **/
  23. ;
  24. CREATE CLASS IF NOT EXISTS /tmpp() WITH autosearch=true, version=false, key=manu, alias='tmpp', namespace='tmpp';
  25. CREATE EDGE TYPE IF NOT EXISTS tmpp.connect "连接"
  26. /**
  27. output()
  28. onerror(continue,`not exist`,`not find`,`not found`)
  29. **/
  30. ;
  31. create class if not exists /tmpp/性能AaB2 (
  32. 主机AaB varchar,
  33. v_date date,
  34. v_timestamp timestamp,
  35. 性能备份AaB bucket {
  36. "dict": true,
  37. "slot": 5,
  38. "ttl": 2,
  39. "type": "promdb",
  40. "version": 1
  41. },
  42. noindex varchar,
  43. 性能AaB bucket {
  44. "dict": true,
  45. "slot": 5,
  46. "ttl": 2,
  47. "type": "promdb",
  48. "version": 1
  49. },
  50. keys(主机AaB),
  51. indexes(主机AaB, v_date, v_timestamp )
  52. )with autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB2'
  53. /**
  54. output()
  55. **/
  56. ;
  57. insert into /tmpp/性能AaB2 (id,主机AaB,v_date,v_timestamp) values ('性能AaB2:test',"[服务器1]","2026-04-02","2026-04-02 15:55:55");
  58. insert into /tmpp/性能AaB2 (id,主机AaB,v_date,v_timestamp) values ('性能AaB2:test2',"*服务器2?","1754-08-31","1901-08-31 15:55:55");
  59. delete 性能备份AaB from /tmpp/性能AaB2 with version
  60. /**
  61. onerror(continue,`not exist`,`not find`,`not found`)
  62. **/
  63. ;
  64. delete 性能AaB from /tmpp/性能AaB2 with version
  65. /**
  66. onerror(continue,`not exist`,`not find`,`not found`)
  67. **/
  68. ;
  69. truncate namespace tmpp ;
  70. /**
  71. output()
  72. sleep(3s)
  73. **/
  74. ;
  75. drop class if exists /tmpp/性能AaB2
  76. /**
  77. output()
  78. sleep(3s)
  79. **/
  80. ;
  81. create class if not exists /tmpp/性能AaB2 (
  82. 主机AaB varchar,
  83. v_date date,
  84. v_timestamp timestamp,
  85. 性能备份AaB bucket {
  86. "dict": true,
  87. "slot": 5,
  88. "ttl": 2,
  89. "type": "promdb",
  90. "version": 1
  91. },
  92. noindex varchar,
  93. 性能AaB bucket {
  94. "dict": true,
  95. "slot": 5,
  96. "ttl": 2,
  97. "type": "promdb",
  98. "version": 1
  99. },
  100. true_name double,
  101. false_name double,
  102. class_name double,
  103. keys(主机AaB),
  104. indexes(主机AaB, v_date, v_timestamp )
  105. )with autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB2'
  106. /**
  107. output()
  108. **/
  109. ;
  110. insert into /tmpp/性能AaB2 (id,主机AaB,v_date,v_timestamp,true_name,false_name,class_name) values ('性能AaB2:test',"[服务器1]","2026-04-02","2026-04-02 15:55:55", 0.1, 0.2, 0.3);
  111. insert into /tmpp/性能AaB2 (id,主机AaB,v_date,v_timestamp,true_name,false_name,class_name) values ('性能AaB2:test2',"*服务器2?","1754-08-31","1901-08-31 15:55:55", 0.1, 0.2, 0.3);
  112. select true_name from /tmpp/性能AaB2 where v_date='1754-08-31' refresh
  113. /**
  114. output()
  115. matchcount("true_name", 0.1, 1)
  116. **/
  117. ;
  118. create ("性能AaB2:test")-[:connect]->("性能AaB2:test3")
  119. /**
  120. output()
  121. **/
  122. ;
  123. select class from /tmpp/性能AaB2 where id='性能AaB2:test3'
  124. /**
  125. output()
  126. matchcount("class", "/tmpp/性能aab2", 1)
  127. **/
  128. ;