bitmap_or_count
description
Syntax
BigIntVal bitmap_or_count(BITMAP lhs, BITMAP rhs, ...)
计算两个及以上输入bitmap的并集,返回并集的个数.
example
1. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'),bitmap_empty());
2. +--------------------------------------------------------------+
3. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_empty()) |
4. +--------------------------------------------------------------+
5. | 3 |
6. +--------------------------------------------------------------+
9. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'),bitmap_from_string('1,2,3'));
10. +---------------------------------------------------------------------------+
11. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2,3')) |
12. +---------------------------------------------------------------------------+
13. | 3 |
14. +---------------------------------------------------------------------------+
16. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5'));
17. +---------------------------------------------------------------------------+
18. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5')) |
19. +---------------------------------------------------------------------------+
20. | 5 |
21. +---------------------------------------------------------------------------+
23. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), bitmap_empty());
24. +-----------------------------------------------------------------------------------------------------------+
25. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), bitmap_empty()) |
26. +-----------------------------------------------------------------------------------------------------------+
27. | 6 |
28. +-----------------------------------------------------------------------------------------------------------+
30. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), NULL);
31. +-------------------------------------------------------------------------------------------------+
32. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), NULL) |
33. +-------------------------------------------------------------------------------------------------+
34. | NULL |
35. +-------------------------------------------------------------------------------------------------+
keywords
1. BITMAP_OR_COUNT,BITMAP
