diff options
author | Pavan Deolasee | 2016-01-28 10:27:54 +0000 |
---|---|---|
committer | Pavan Deolasee | 2016-10-18 09:48:12 +0000 |
commit | c33f935b3bd726601b1f51abc3b7152092d1ba4f (patch) | |
tree | f7946b49599dc449bdd2fc513e3da6b7dff2ccdc | |
parent | c2505d5e7d79ebcb3ffb4f75188ed1a1492d9dbd (diff) |
Do not override the sequence_range setting in COPY
The default value of this parameter has now been hiked to 1000. So there is no
good reason to override this in COPY, if the user has explicitly set it back to
1. Honor user defined value in all cases.
We can possibly flag a warning if sequences are being incremened too fast and
the current value of sequence_range is set too low. But no compelling need to
do that just now.
-rw-r--r-- | src/backend/commands/copy.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index a356229140..0910ecc088 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -846,9 +846,6 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed) bool is_from = stmt->is_from; bool pipe = (stmt->filename == NULL); Relation rel; -#ifdef XCP - int oldSeqRangeVal = SequenceRangeVal; -#endif Oid relid; Node *query = NULL; List *range_table = NIL; @@ -974,26 +971,6 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed) rel = NULL; } -#ifdef XCP - /* - * The COPY might involve sequences. We want to cache a range of - * sequence values to avoid contacting the GTM repeatedly. This - * improves the COPY performance by quite a margin. We set the - * SequenceRangeVal GUC parameter to bring about this effect. - * Note that we could have checked the attribute list to ascertain - * if this GUC is really needed or not. However since this GUC - * only affects nextval calculations, if sequences are not present - * no harm is done.. - * - * The user might have set the GUC value himself. Honor that if so - */ - -#define MAX_CACHEVAL 1024 - if (rel && getOwnedSequences(RelationGetRelid(rel)) != NIL && - SequenceRangeVal == DEFAULT_CACHEVAL) - SequenceRangeVal = MAX_CACHEVAL; -#endif - if (is_from) { Assert(rel); @@ -1027,11 +1004,6 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed) EndCopyTo(cstate); } -#ifdef XCP - /* Set the SequenceRangeVal GUC to its earlier value */ - SequenceRangeVal = oldSeqRangeVal; -#endif - /* * Close the relation. If reading, we can release the AccessShareLock we * got; if writing, we should hold the lock until end of transaction to |