IMHO this new coersion optimization as introduced in changeset 5786f1be12bb only works correctly for decimal casts (coersions) that do not change the scale (number of decimals), i.e., when the first and last argument (i.e., input and output number of decimals, respectively) are identical. This sanity check is currently missing in the code. Stefan ----- Original Message -----
Changeset: 289a5a038774 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=289a5a038774 Modified Files: monetdb5/optimizer/opt_coercion.c Branch: default Log Message:
coercionOptimizerCalcStep(): fixing changeset 71bfaf7e9841: also handle TYPE_hge to re-activate the intended behavior of changeset 5786f1be12bb
OPEN ISSUE / QUESTION:
This optimizer now (only) handles (i.e., removes) decimal (up-)casts, but no plain/pure integer casts at all.
(a) Shouldn't we also handle (remove) plain/pure integer casts?
(b) Can we always safely remove decimal (up-)casts without altering semantics?
diffs (13 lines):
diff --git a/monetdb5/optimizer/opt_coercion.c b/monetdb5/optimizer/opt_coercion.c --- a/monetdb5/optimizer/opt_coercion.c +++ b/monetdb5/optimizer/opt_coercion.c @@ -65,6 +65,9 @@ coercionOptimizerCalcStep(MalBlkPtr mb, case TYPE_sht: case TYPE_int: case TYPE_lng: +#ifdef HAVE_HGE + case TYPE_hge: +#endif break; case TYPE_dbl: case TYPE_flt: _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |