bitmap_and_not,bitmap_andnot

description

Syntax

BITMAP BITMAP_AND_NOT(BITMAP lhs, BITMAP rhs)

将两个bitmap进行与非操作并返回计算结果。

example

1. mysql> select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5'))) cnt;
2. +------+
3. | cnt  |
4. +------+
5. |    2 |
6. +------+

8. mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')));
9. +--------------------------------------------------------------------------------------------+
10. | bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'))) |
11. +--------------------------------------------------------------------------------------------+
12. | 1,2                                                                                        |
13. +--------------------------------------------------------------------------------------------+
14. 1 row in set (0.01 sec)

16. mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_empty())) ;
17. +-------------------------------------------------------------------------------+
18. | bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), bitmap_empty())) |
19. +-------------------------------------------------------------------------------+
20. | 1,2,3                                                                         |
21. +-------------------------------------------------------------------------------+

23. mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),NULL));
24. +---------------------------------------------------------------------+
25. | bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), NULL)) |
26. +---------------------------------------------------------------------+
27. | NULL                                                                |
28. +---------------------------------------------------------------------+

keywords

1. BITMAP_AND_NOT,BITMAP_ANDNOT,BITMAP