Обсуждение: Re: [COMMITTERS] pgsql: Change FETCH/MOVE to use int8.
Tom Lane wrote: > momjian@postgresql.org (Bruce Momjian) writes: > > Log Message: > > ----------- > > Change FETCH/MOVE to use int8. > > This patch has broken half the buildfarm, and I've still not seen a > rationale why we need to make such a change at all. Fixed with attached patch. The use case for this was not FETCH, but MOVE for > 2gig tables. -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + Index: src/backend/tcop/pquery.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/tcop/pquery.c,v retrieving revision 1.108 diff -c -c -r1.108 pquery.c *** src/backend/tcop/pquery.c 2 Sep 2006 18:17:17 -0000 1.108 --- src/backend/tcop/pquery.c 3 Sep 2006 01:13:20 -0000 *************** *** 1347,1353 **** * we are. In any case, we arrange to fetch the target row * going forwards. */ ! if (portal->posOverflow || portal->portalPos == LLONG_MAX || count - 1 <= portal->portalPos / 2) { DoPortalRewind(portal); --- 1347,1353 ---- * we are. In any case, we arrange to fetch the target row * going forwards. */ ! if (portal->posOverflow || portal->portalPos == FETCH_ALL || count - 1 <= portal->portalPos / 2) { DoPortalRewind(portal); Index: src/include/nodes/parsenodes.h =================================================================== RCS file: /cvsroot/pgsql/src/include/nodes/parsenodes.h,v retrieving revision 1.327 diff -c -c -r1.327 parsenodes.h *** src/include/nodes/parsenodes.h 2 Sep 2006 18:17:17 -0000 1.327 --- src/include/nodes/parsenodes.h 3 Sep 2006 01:13:22 -0000 *************** *** 14,19 **** --- 14,21 ---- #ifndef PARSENODES_H #define PARSENODES_H + #include "limits.h" + #include "nodes/primnodes.h" #include "nodes/value.h" *************** *** 1439,1445 **** --- 1441,1452 ---- FETCH_RELATIVE } FetchDirection; + #ifdef HAVE_INT64 #define FETCH_ALL LLONG_MAX + #else + #define FETCH_ALL LONG_MAX + #endif + typedef struct FetchStmt {
Bruce Momjian <bruce@momjian.us> writes: >> This patch has broken half the buildfarm, and I've still not seen a >> rationale why we need to make such a change at all. > Fixed with attached patch. The use case for this was not FETCH, but > MOVE for > 2gig tables. There is *no* credible use case for this (hint: MOVE FORWARD/BACKWARD ALL does not need this to work for >2G tables). It is not worth the extra computational cycles that it imposes on every machine whether they use the feature or not, and it is certainly not worth the developer time we're expending to fix this poorly written patch. Please revert it. regards, tom lane
Tom Lane wrote: > Bruce Momjian <bruce@momjian.us> writes: > >> This patch has broken half the buildfarm, and I've still not seen a > >> rationale why we need to make such a change at all. > > > Fixed with attached patch. The use case for this was not FETCH, but > > MOVE for > 2gig tables. > > There is *no* credible use case for this (hint: MOVE FORWARD/BACKWARD > ALL does not need this to work for >2G tables). It is not worth the > extra computational cycles that it imposes on every machine whether they > use the feature or not, and it is certainly not worth the developer time > we're expending to fix this poorly written patch. Please revert it. Already done because of bad coding. You want the TODO item removed too? -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +
Bruce Momjian <bruce@momjian.us> writes: > Tom Lane wrote: >> There is *no* credible use case for this (hint: MOVE FORWARD/BACKWARD >> ALL does not need this to work for >2G tables). > Already done because of bad coding. You want the TODO item removed too? As I said, I see no use case for it. Maybe if Moore's Law holds up for another five or ten years, it'll look like a useful feature then ... regards, tom lane
Tom Lane wrote: > Bruce Momjian <bruce@momjian.us> writes: > > Tom Lane wrote: > >> There is *no* credible use case for this (hint: MOVE FORWARD/BACKWARD > >> ALL does not need this to work for >2G tables). > > > Already done because of bad coding. You want the TODO item removed too? > > As I said, I see no use case for it. Maybe if Moore's Law holds up for > another five or ten years, it'll look like a useful feature then ... Removed. -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +