bitmap_or_count

description

Syntax

BigIntVal bitmap_or_count(BITMAP lhs, BITMAP rhs)

Calculates the union of two or more input bitmaps and returns the number of union sets.

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. +--------------------------------------------------------------+
  7. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'),bitmap_from_string('1,2,3'));
  8. +---------------------------------------------------------------------------+
  9. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2,3')) |
  10. +---------------------------------------------------------------------------+
  11. | 3 |
  12. +---------------------------------------------------------------------------+
  13. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5'));
  14. +---------------------------------------------------------------------------+
  15. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5')) |
  16. +---------------------------------------------------------------------------+
  17. | 5 |
  18. +---------------------------------------------------------------------------+
  19. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), bitmap_empty());
  20. +-----------------------------------------------------------------------------------------------------------+
  21. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), bitmap_empty()) |
  22. +-----------------------------------------------------------------------------------------------------------+
  23. | 6 |
  24. +-----------------------------------------------------------------------------------------------------------+
  25. MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), NULL);
  26. +-------------------------------------------------------------------------------------------------+
  27. | bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'), to_bitmap(100), NULL) |
  28. +-------------------------------------------------------------------------------------------------+
  29. | NULL |
  30. +-------------------------------------------------------------------------------------------------+

keyword

  1. BITMAP_OR_COUNT,BITMAP