BTEQ 20.00.00.11; tested 24 October 2026
 
+---------+---------+---------+---------+---------+---------+---------+----
-- Login omitted; authenticate with your own lab account.

 *** Logon successfully completed.
 *** Teradata Database Release is 20.00.28.81                   
 *** Teradata Database Version is 20.00.28.81                     
 *** Transaction Semantics are BTET.
 *** Session Character Set Name is 'ASCII'.
 
 *** Total elapsed time was 1 second.
 
+---------+---------+---------+---------+---------+---------+---------+----
-- DWHPro controlled lab. Dedicated disposable user, BTET mode, 4 AMPs.
-- DBA setup: an otherwise idle user with SPOOL=16000000 bytes, no profile override.
-- Do not run this deliberately failing example in a production session.
.SET WIDTH 240
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.SET TITLEDASHES OFF
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT InfoKey,InfoData FROM DBC.DBCInfoV WHERE InfoKey IN ('VERSION','RELEASE');

 *** Query completed. 2 rows found. 2 columns returned. 
 *** Total elapsed time was 1 second.

InfoKey                        InfoData
VERSION                        20.00.28.81
RELEASE                        20.00.28.81

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
CREATE MULTISET VOLATILE TABLE dwhpro_bench_digits (n INTEGER) PRIMARY INDEX(n) ON COMMIT PRESERVE ROWS;

 *** Table has been created. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(0);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(1);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(2);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(3);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(4);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(5);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(6);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(7);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(8);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_digits VALUES(9);

 *** Insert completed. One row added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
CREATE MULTISET VOLATILE TABLE dwhpro_bench_source (id INTEGER, hot_key INTEGER, payload CHAR(200)) PRIMARY INDEX(id) ON COMMIT PRESERVE ROWS;

 *** Table has been created. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_source
SELECT a.n+10*b.n+100*c.n+1000*d.n AS id, 1, CAST('x' AS CHAR(200))
FROM dwhpro_bench_digits a CROSS JOIN dwhpro_bench_digits b CROSS JOIN dwhpro_bench_digits c CROSS JOIN dwhpro_bench_digits d;

 *** Insert completed. 10000 rows added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
CREATE MULTISET VOLATILE TABLE dwhpro_bench_skew AS dwhpro_bench_source WITH NO DATA PRIMARY INDEX(hot_key) ON COMMIT PRESERVE ROWS;

 *** Table has been created. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
CREATE MULTISET VOLATILE TABLE dwhpro_bench_even AS dwhpro_bench_source WITH NO DATA PRIMARY INDEX(id) ON COMMIT PRESERVE ROWS;

 *** Table has been created. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'PLAN SKEW' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
PLAN SKEW

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
EXPLAIN INSERT INTO dwhpro_bench_skew SELECT * FROM dwhpro_bench_source;

 *** Help information returned. 17 rows.
 *** Total elapsed time was 1 second.

Explanation
  1) First, we do an all-AMPs RETRIEVE step in TD_MAP1 from
     DWHPRO_BENCH_20261024.dwhpro_bench_source by way of an all-rows
     scan with no residual conditions into Spool 1 (all_amps), which is
     redistributed by the hash code of (
     DWHPRO_BENCH_20261024.dwhpro_bench_source.hot_key) to all AMPs in
     TD_MAP1.  Then we do a SORT to order Spool 1 by row hash.  The
     size of Spool 1 is estimated with high confidence to be 10,000
     rows (2,210,000 bytes).  The estimated time for this step is 0.03
     seconds.
  2) Next, we do an all-AMPs MERGE step in TD_MAP1 into
     DWHPRO_BENCH_20261024.dwhpro_bench_skew from Spool 1 (Last Use).
     The size is estimated with high confidence to be 10,000 rows.  The
     estimated time for this step is 1.50 seconds.
  3) We spoil the parser's dictionary cache for the table.
  4) Finally, we send out an END TRANSACTION step to all AMPs involved
     in processing the request.
  -> No rows are returned to the user as the result of statement 1.

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'PLAN BALANCED' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
PLAN BALANCED

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
EXPLAIN INSERT INTO dwhpro_bench_even SELECT * FROM dwhpro_bench_source;

 *** Help information returned. 9 rows.
 *** Total elapsed time was 1 second.

Explanation
  1) First, we do an all-AMPs MERGE step in TD_MAP1 into
     DWHPRO_BENCH_20261024.dwhpro_bench_even from
     DWHPRO_BENCH_20261024.dwhpro_bench_source.  The size is estimated
     with no confidence to be 10,000 rows.  The estimated time for this
     step is 1.50 seconds.
  2) Next, we spoil the parser's dictionary cache for the table.
  3) Finally, we send out an END TRANSACTION step to all AMPs involved
     in processing the request.
  -> No rows are returned to the user as the result of statement 1.

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'BASELINE' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
BASELINE

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT Vproc,CurrentSpool,MaxSpool FROM DBC.DiskSpaceV WHERE DatabaseName=USER ORDER BY Vproc;

 *** Query completed. 4 rows found. 3 columns returned. 
 *** Total elapsed time was 1 second.

         Vproc                CurrentSpool                    MaxSpool
             0                   1,220,608                   4,000,000
             1                   1,220,608                   4,000,000
             2                   1,224,704                   4,000,000
             3                   1,224,704                   4,000,000

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'SKEW RUN 1' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
SKEW RUN 1

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_skew SELECT * FROM dwhpro_bench_source;
 *** Failure 2646 No more spool space in dwhpro_bench_20261024.
                Statement# 1, Info =0 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.IF ERRORCODE <> 2646 THEN .QUIT 9
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'SKEW RETAINED' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
SKEW RETAINED

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT Vproc,CurrentSpool,MaxSpool FROM DBC.DiskSpaceV WHERE DatabaseName=USER ORDER BY Vproc;

 *** Query completed. 4 rows found. 3 columns returned. 
 *** Total elapsed time was 1 second.

         Vproc                CurrentSpool                    MaxSpool
             0                     172,032                   4,000,000
             1                   1,220,608                   4,000,000
             2                   1,224,704                   4,000,000
             3                   1,224,704                   4,000,000

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DELETE FROM dwhpro_bench_skew ALL;

 *** Delete completed. No rows removed. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'BALANCED RUN 1' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
BALANCED RUN 1

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_even SELECT * FROM dwhpro_bench_source;

 *** Insert completed. 10000 rows added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'BALANCED RETAINED' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
BALANCED RETAINED

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT Vproc,CurrentSpool,MaxSpool FROM DBC.DiskSpaceV WHERE DatabaseName=USER ORDER BY Vproc;

 *** Query completed. 4 rows found. 3 columns returned. 
 *** Total elapsed time was 1 second.

         Vproc                CurrentSpool                    MaxSpool
             0                   1,294,336                   4,000,000
             1                   2,342,912                   4,000,000
             2                   2,351,104                   4,000,000
             3                   2,351,104                   4,000,000

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT COUNT(*) AS rows_retained,MIN(id) AS first_id,MAX(id) AS last_id FROM dwhpro_bench_even;

 *** Query completed. One row found. 3 columns returned. 
 *** Total elapsed time was 1 second.

rows_retained     first_id      last_id
        10000            0         9999

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DELETE FROM dwhpro_bench_even ALL;

 *** Delete completed. 10000 rows removed. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'SKEW RUN 2' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
SKEW RUN 2

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_skew SELECT * FROM dwhpro_bench_source;
 *** Failure 2646 No more spool space in dwhpro_bench_20261024.
                Statement# 1, Info =0 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.IF ERRORCODE <> 2646 THEN .QUIT 9
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DELETE FROM dwhpro_bench_skew ALL;

 *** Delete completed. No rows removed. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'BALANCED RUN 2' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
BALANCED RUN 2

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_even SELECT * FROM dwhpro_bench_source;

 *** Insert completed. 10000 rows added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DELETE FROM dwhpro_bench_even ALL;

 *** Delete completed. 10000 rows removed. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'SKEW RUN 3' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
SKEW RUN 3

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_skew SELECT * FROM dwhpro_bench_source;
 *** Failure 2646 No more spool space in dwhpro_bench_20261024.
                Statement# 1, Info =0 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.IF ERRORCODE <> 2646 THEN .QUIT 9
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DELETE FROM dwhpro_bench_skew ALL;

 *** Delete completed. No rows removed. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT 'BALANCED RUN 3' AS phase;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

phase
BALANCED RUN 3

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
INSERT INTO dwhpro_bench_even SELECT * FROM dwhpro_bench_source;

 *** Insert completed. 10000 rows added. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT COUNT(*) AS final_rows FROM dwhpro_bench_even;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

 final_rows
      10000

+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DROP TABLE dwhpro_bench_even;

 *** Table has been dropped. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DROP TABLE dwhpro_bench_skew;

 *** Table has been dropped. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DROP TABLE dwhpro_bench_source;

 *** Table has been dropped. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
DROP TABLE dwhpro_bench_digits;

 *** Table has been dropped. 
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.LOGOFF
 *** You are now logged off from the DBC.
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.QUIT
 *** Exiting BTEQ...
 *** RC (return code) = 8 

Disposable lab user removed.
