Re: Hash partitioning. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Hash partitioning.
Date
Msg-id 11325.1372176514@sss.pgh.pa.us
Whole thread Raw
In response to Re: Hash partitioning.  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Hash partitioning.  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> I looked at predtest.c but I can't see how we accept >= and <= ranges,
> but not CHECK (a % 16 == 3).  It is the '%' operator?  I am not sure why
> the hashme() function is there.  Wouldn't it work if hashme() was an
> immutable function?

No.  Robert's description is exactly correct: it's a question of whether
we can know that the semantics of function X have anything to do with
the behavior of operator Y.  In the case of something like CHECK (X >= 16)
combined with WHERE X = 10, if the given = and >= operators belong to
the same btree opclass family then we can assume that their semantics
are compatible and then apply reasoning to show that these two clauses
can't both be true for the same value of X.  We can *not* use "X = 10"
to reason about the behavior of anything that isn't in the = operator's
btree opclass, because we don't assume that "=" means "absolutely
identical for every purpose".  And in fact it does not mean that for
several pretty common datatypes (float being another example besides
numeric).
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: refresh materialized view concurrently
Next
From: "Yuri Levinsky"
Date:
Subject: Re: Hash partitioning.