88_cache.mql 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. delete 性能备份AaB from /test/性能AaB_Cache with version
  2. /**
  3. onerror(continue,`not exist`,`not find`,`not found`)
  4. **/
  5. ;
  6. delete 性能AaB from /test/性能AaB_Cache with version
  7. /**
  8. onerror(continue,`not exist`,`not find`,`not found`)
  9. **/
  10. ;
  11. delete from /test/性能AaB_Cache with version
  12. /**
  13. onerror(continue,`not exist`,`not find`,`not found`)
  14. **/
  15. ;
  16. drop class if exists /test/性能AaB_Cache;
  17. create class if not exists /test/性能AaB_Cache (
  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=cacheonly, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_Cache'
  39. ;
  40. insert into /test/性能AaB_Cache (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
  41. select count(*) from /test/性能AaB_Cache where 主机AaB='服务器1'
  42. /**
  43. output()
  44. count(1)
  45. **/
  46. ;
  47. cql: select * from field where namespace='test' and name in ('主机aab','noindex')
  48. /**
  49. match("name", "主机aab", "isindex", 1)
  50. match("name", "noindex", "isindex", 0)
  51. **/
  52. ;
  53. select * from /test/性能AaB_Cache where v_date between '2026-04-02' and '2026-04-03' limit 10
  54. /**
  55. output()
  56. count(1)
  57. **/
  58. ;
  59. select * from /test/性能AaB_Cache where v_date between 1774972800000 and 1776182400000 limit 10
  60. /**
  61. output()
  62. count(1)
  63. **/
  64. ;
  65. select * from /test/性能AaB_Cache where v_timestamp between '2026-04-02 00:00:00.000' and '2026-04-03 00:00:00.000' limit 10
  66. /**
  67. output()
  68. count(1)
  69. **/
  70. ;
  71. select * from /test/性能AaB_Cache where v_timestamp between 1774972800000 and 1776182400000 limit 10
  72. /**
  73. output()
  74. count(1)
  75. **/
  76. ;