-
- Downloads
Adjust the API for aggregate function calls so that a C-coded function
can tell whether it is being used as an aggregate or not. This allows such a function to avoid re-pallocing a pass-by-reference transition value; normally it would be unsafe for a function to scribble on an input, but in the aggregate case it's safe to reuse the old transition value. Make int8inc() do this. This gets a useful improvement in the speed of COUNT(*), at least on narrow tables (it seems to be swamped by I/O when the table rows are wide). Per a discussion in early December with Neil Conway. I also fixed int_aggregate.c to check this, thereby turning it into something approaching a supportable technique instead of being a crude hack.
Showing
- contrib/intagg/int_aggregate.c 70 additions, 47 deletionscontrib/intagg/int_aggregate.c
- contrib/intagg/int_aggregate.sql.in 3 additions, 8 deletionscontrib/intagg/int_aggregate.sql.in
- doc/src/sgml/xaggr.sgml 16 additions, 1 deletiondoc/src/sgml/xaggr.sgml
- doc/src/sgml/xfunc.sgml 15 additions, 5 deletionsdoc/src/sgml/xfunc.sgml
- src/backend/executor/nodeAgg.c 19 additions, 2 deletionssrc/backend/executor/nodeAgg.c
- src/backend/utils/adt/int8.c 39 additions, 10 deletionssrc/backend/utils/adt/int8.c
Loading
Please register or sign in to comment