diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-13 15:02:32 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-13 15:02:32 +0000 |
| commit | db3c4c3a2d980dcdd9a19feeddd11230587f0d21 (patch) | |
| tree | 2505c67a886b7f5696fa8885da1a98219043e14d /src/backend/executor | |
| parent | c3ac9f07b7bf2f764155a9b0e97c761fa780ac27 (diff) | |
| download | postgresql-db3c4c3a2d980dcdd9a19feeddd11230587f0d21.tar.gz | |
Split 'BufFile' routines out of fd.c into a new module, buffile.c. Extend
BufFile so that it handles multi-segment temporary files transparently.
This allows sorts and hashes to work with data exceeding 2Gig (or whatever
the local limit on file size is). Change psort.c to use relative seeks
instead of absolute seeks for backwards scanning, so that it won't fail
when the data volume exceeds 2Gig.
Diffstat (limited to 'src/backend/executor')
| -rw-r--r-- | src/backend/executor/nodeHash.c | 9 | ||||
| -rw-r--r-- | src/backend/executor/nodeHashjoin.c | 14 |
2 files changed, 6 insertions, 17 deletions
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c index 214cc7f069..c6295acf72 100644 --- a/src/backend/executor/nodeHash.c +++ b/src/backend/executor/nodeHash.c @@ -6,7 +6,7 @@ * Copyright (c) 1994, Regents of the University of California * * - * $Id: nodeHash.c,v 1.38 1999/07/17 20:16:58 momjian Exp $ + * $Id: nodeHash.c,v 1.39 1999/10/13 15:02:25 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -75,12 +75,7 @@ ExecHash(Hash *node) * ---------------- */ for (i = 0; i < nbatch; i++) - { - File tfile = OpenTemporaryFile(); - - Assert(tfile >= 0); - hashtable->innerBatchFile[i] = BufFileCreate(tfile); - } + hashtable->innerBatchFile[i] = BufFileCreateTemp(); } /* ---------------- diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index 439b8634cd..ffda972318 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.26 1999/07/17 20:16:58 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.27 1999/10/13 15:02:25 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -129,12 +129,7 @@ ExecHashJoin(HashJoin *node) * ---------------- */ for (i = 0; i < hashtable->nbatch; i++) - { - File tfile = OpenTemporaryFile(); - - Assert(tfile >= 0); - hashtable->outerBatchFile[i] = BufFileCreate(tfile); - } + hashtable->outerBatchFile[i] = BufFileCreateTemp(); } else if (hashtable == NULL) return NULL; @@ -551,13 +546,12 @@ ExecHashJoinNewBatch(HashJoinState *hjstate) * Rewind inner and outer batch files for this batch, so that we can * start reading them. */ - if (BufFileSeek(hashtable->outerBatchFile[newbatch - 1], 0L, - SEEK_SET) != 0L) + if (BufFileSeek(hashtable->outerBatchFile[newbatch - 1], 0, 0L, SEEK_SET)) elog(ERROR, "Failed to rewind hash temp file"); innerFile = hashtable->innerBatchFile[newbatch - 1]; - if (BufFileSeek(innerFile, 0L, SEEK_SET) != 0L) + if (BufFileSeek(innerFile, 0, 0L, SEEK_SET)) elog(ERROR, "Failed to rewind hash temp file"); /* |
