Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2650

Support using generated primary keys along with batch inserts

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.M1
    • Component/s: Core Library
    • Labels:
      None

      Description

      Currently, using generated PKs explicitly prevents multiple inserts from using a batch-bind insert. This is unhelpful since switching to generated PKs could potentially cause a performance decrease for certain use cases because of the lack of batch insert functionality.

      This is prohibited by the existing BatchAction:

      if (runningAsBatch && !generatesKeys) {
      	runAsBatch(connection, translator, observer);
      } else {
      	runAsIndividualQueries(connection, translator, observer, generatesKeys);
      }

      Having done very brief performance testing against PostgreSQL, the performance difference turns out to be minimal for a realistic production scenario, but even so, this is a restriction worth removing I think.

      I have a pull request coming for this.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                johnthuss John Huss
                Reporter:
                johnthuss John Huss
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m