ExpPCodeOptimizations.cpp

Clone Tools
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Move core into subdir to combine repos

  1. … 10768 more files in changeset.
Move core into subdir to combine repos

  1. … 10622 more files in changeset.
Move core into subdir to combine repos

Use: git log --follow -- <file>

to view file history thru renames.

  1. … 10837 more files in changeset.
Add new PCode Expression Cache feature.

This new cache is maintained by the SQL Compiler. The purpose of this

cache is to avoid the fairly expensive logic involved in transforming

unoptimized PCode to optimized PCode and, where applicable, to also

avoid

the logic involved in transforming optimized PCode to a Native

Expression. This cache is accessed ONLY by the SQL Compiler code.

NOTES:

* This is second attempt to check in this code. First attempt had to

be abandoned as other developers made changes which prevented

automatic merging.

* This code has been pre-reviewed by Justin, Qifan, Selva, Mike,

Ravisha, Suresh, and Dave B. Many thanks to them for various

suggestions. Most of those suggestions have been incorporated into

this delivery. A few are left for future improvements.

* There is one instance of this new cache per CmpContext.

* There are 5 new CQDs used to control this cache. To be effective for

all instances of the cache, these need to be set in the system

defaults table. The CQD command given to sqlci will affect only the

instance of the cache for the current CmpContext.

The 5 CQDs are:

PCODE_EXPR_CACHE_ENABLED - set to 0 to disable the cache. Default is 1

PCODE_EXPR_CACHE_SIZE - max size in bytes. Default is 2,000,000.

PCODE_EXPR_CACHE_CMP_ONLY - Compare Only mode - useful to QA and

Development only.

PCODE_EXPR_CACHE_DEBUG - set to 1 to enable debug mode. Default is 0

PCODE_DEBUG_LOGDIR - pathname of existing directory where debug log

files will be placed -- one log file per cache

instance. Log files are designed to be easily

imported into an Excel Spreadsheet. No default.

* Also included are a small number of changes to the Native Expressions

feature to (a) Use the new PCODE_DEBUG_LOGDIR cqd to specify where to

put the Native Expressions debug log files, (b) measure cpu-time

rather than wall-clock time for measuring how long it took to produce

a Native Expression, and (c) add a CQD named PCODE_NE_ENABLED so we

can easily disable the Native Expressions feature [though there is

currently no known reason for doing so.]

Change-Id: I58f833f63099743ff6c1107acdff94fe8aef4b70

  1. … 14 more files in changeset.
SHOWPLAN related changes

Reworked the fix for bug 1392522 - mxosrvr core dumped doing showplan

(with N.E. enabled), plus other related code changes.

1) The native code (also known as native expression), if generated, is

stored in the expression's constant area. SHOWPLAN will dump the native

code in the assembly format. The display can be disabled by CQD

PCODE_NE_IN_SHOWPLAN to "OFF". It is "ON" by default. This part had been

reviewed by Jim Capps and Mike Hanlon.

2) Add several SHOWPLAN statements in core/TEST019 without logging the

output. This is to ensure no core generated when getting executor

operator (TDBs) info via SHOWPLAN.

3) A temporary fix to ComTdbHbaseAccess::displayRowId(). The current way

of retrieving begin or end row IDs from the HbaseScanRows for SHOWPLAN

does not match with the way those row IDs are generated (see

HbaseAccess::genListsOfRows), causing core dumps in some cases.

Change-Id: Id33e8c854452c03e15c4bd21f668f123180d9471

  1. … 9 more files in changeset.
Fix bug 1392522 - mxosrvr core dumped doing showplan (with N.E. enabled)

The basic problem was that PCodeCfg::generateShowPlan() called

PCodeCfg::layoutNativeCode() when the PCODE that had been generated

was unoptimized PCODE. PCodeCfg::layoutNativeCode() expects to be

called with optimized PCODE and is not able to handle some strange

qualities about unoptimized PCODE.

This fix changes PCodeCfg::generateShowPlan() to put out a simple

message saying the a Native Expression exists but will not be

displayed as part of the showplan output. In the future, we should

be able to implement a complete fix and display the Native Expression,

but in the meantime, we do not want to produce core dumps.

Since showplan is not documented for customer usage, this temporary

fix will not affect customers. Also, if developers want to obtain

the assembler language for the Native Expression, we can obtain that

by turning on the CQDs that are used to debug the Native Expressions

logic.

Ran standard Trafodion developer regression tests.

Change-Id: I891a9c0bfbe680667a56f9b0ad4674ed0a0b1cbf

Changes to support OSS poc.

This checkin contains multiple changes that were added to support OSS poc.

These changes are enabled through a special cqd mode_special_4 and not

yet externalized for general use.

A separate spec contains details of these changes.

These changes have been contributed and pre-reviewed by Suresh, Jim C,

Ravisha, Mike H, Selva and Khaled.

All dev regressions have been run and passed.

Change-Id: I2281c1b4ce7e7e6a251bbea3bf6dc391168f3ca3

  1. … 143 more files in changeset.
Fix LP bug 1325716 -TIME(1) default CURRENT_TIME reported wrong values

When doing CSE (Common Subexpression Elimination), if we come across a

convert clause, we must interrogate the details of the conversion

before deciding this is a match with another conversion we have

already done. In particular, the source's precision, scale, and type

must be the same as in the previous conversion and, likewise, for

the target.

Pre-reviewed by Justin.

All dev regressions were run to ensure that the fix has no

side-effects.

Files changed:

sql/exp/ExpPCodeOptimizations.cpp

Change-Id: I2705cef151ef163a43e1eef31ee47ef94d164051

Fix bug 1370151 - PCODE Optimization code was looping forever

Under some circumstances, the PCode optimization logic was calling

memset() with a length argument that was a negative value.

Change-Id: Ie4aa96b6614ccfe9ffe6fb5d88cca41a046c7de7

various fixes from multiple folks.

showplan display fix (Jim C)

sqenvcom.sh update for hive (Suresh S)

internal cqd to control esps (Ravisha/Taoufik)

rowset unique select was incorrectly being chosen in some case.

mdam predicate was causing executor crash due to an incorrect key expr.

temp change to add a 1 sec delay after an insert query to complete flush to hbase. (only done from sqlci during regress runs)

Change-Id: I4dbbf4cb60748d4fe82cc93c89db3b25af11f18f

  1. … 11 more files in changeset.
Initial code drop of Trafodion

    • -0
    • +8891
    ./ExpPCodeOptimizations.cpp
  1. … 4886 more files in changeset.