Bitmapset data type??? - Mailing list pgsql-hackers

From Martha Chronopoulou
Subject Bitmapset data type???
Date
Msg-id 41C5A0BF.2050409@aueb.gr
Whole thread Raw
Responses Re: Bitmapset data type???
List pgsql-hackers
Hi all,

I'm tring to understand a part of code of postgres and I saw a line like
this:
"bms_is_subset(restrictinfo->right_relids,outerrelids)"  (createplan.c,
function get_switched_clauses() at ~/src/backend/optimizer/plan).
I don't understand the data types of the the arguments
of that function. The datatype of those arguments is Bitmapset,
i.e.
typedef struct Bitmapset
{
int nwords;
bitmapword words[1];
}Bitmapset;             (bitmapset.h at ~/src/include/nodes)

and bitmapword is:
typedef unit32 bitmapword; (bitmapset.h at ~/src/include/nodes)

and the prototype of the function is:
extern bool bms_is_subset(const Bitmapset *a, const Bitmapset *b);
(bitmapset.h at ~/src/include/nodes)


The following is at the file bitmapset.h at dir  ~/src/include/nodes)
"A bitmap set can represent any set of nonnegative integers, although it is mainly intented for sets where the maximum
valueis not large, say
 
at most a few hundred.By convention, a NULL pointer is always accepted
by all operations to represent the empty set.(But beware that this is
not the only representation of the empty set. Use bms_is_empty() in
preference to testing for NULL.)"

Can someone explain to me please the datatype Bitmapset?
I'm confused.

Thanks in advance!!! 
- martha



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Help extending pg_class
Next
From: Alvaro Herrera
Date:
Subject: Re: Bitmapset data type???