Bitmapset data type???

From: Martha Chronopoulou <mchron(at)aueb(dot)gr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Bitmapset data type???
Date: 2004-12-19 15:39:43
Message-ID: 41C5A0BF.2050409@aueb.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 value is 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2004-12-19 18:03:47 Re: Bitmapset data type???
Previous Message Gaetano Mendola 2004-12-19 15:35:01 Stable functions problem