Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6003

Create row templates outside of the generated code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.10.1.1
    • 10.10.1.1
    • SQL
    • None

    Description

      The constructors for many of the result set classes take GeneratedMethod parameters that create row templates (an ExecRow of a certain size and column types, each column initialized to an SQL null value).

      As an alternative, the compiler could produce an ExecRow instance and put it into the savedObjects field of GenericPreparedStatement, and the constructors could take parameter that points to the object in savedObjects. Where the result sets currently invoke the generated method to produce a fresh template, they could instead clone the saved object.

      Advantages with the suggested approach would be:

      • Reduce the size of the code generator, which should reduce total code complexity.
      • Reduce the amount of generated code, which makes it easier for tools (profilers, static code analyzers, IDEs) to map executable code to source code.
      • Reduce the actual number of generated methods, which makes it less likely that queries need to use reflection to invoke the remaining generated methods (there's a switchover from DirectCall to ReflectCall when the number of generated methods exceeds 10).

      Attachments

        1. d6003-1a-cleanup.diff
          10 kB
          Knut Anders Hatlen
        2. d6003-2a-unused-field.diff
          6 kB
          Knut Anders Hatlen
        3. d6003-3a-safe-downgrade.diff
          9 kB
          Knut Anders Hatlen
        4. d6003-3b-downgrade-workaround-in-tests.diff
          11 kB
          Knut Anders Hatlen
        5. d6003-3c-downgrade-with-stored-proc.diff
          11 kB
          Knut Anders Hatlen
        6. d6003-4a-scanresultset.diff
          76 kB
          Knut Anders Hatlen
        7. d6003-5a-sort-vti-aggregate-window.diff
          36 kB
          Knut Anders Hatlen
        8. d6003-6a-index-to-base-row.diff
          18 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: