From commits-return-7138-archive-asf-public=cust-asf.ponee.io@trafodion.apache.org Tue Mar 20 02:04:05 2018
Return-Path:
X-Original-To: archive-asf-public@cust-asf.ponee.io
Delivered-To: archive-asf-public@cust-asf.ponee.io
Received: from mail.apache.org (hermes.apache.org [140.211.11.3])
by mx-eu-01.ponee.io (Postfix) with SMTP id 4E6191807A6
for ; Tue, 20 Mar 2018 02:04:02 +0100 (CET)
Received: (qmail 37649 invoked by uid 500); 20 Mar 2018 01:04:01 -0000
Mailing-List: contact commits-help@trafodion.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: commits@trafodion.apache.org
Delivered-To: mailing list commits@trafodion.apache.org
Received: (qmail 37258 invoked by uid 99); 20 Mar 2018 01:04:00 -0000
Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23)
by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2018 01:04:00 +0000
Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33)
id D7020F66F7; Tue, 20 Mar 2018 01:03:59 +0000 (UTC)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: dbirdsall@apache.org
To: commits@trafodion.apache.org
Date: Tue, 20 Mar 2018 01:04:08 -0000
Message-Id: <0e1520872b1745859c8e6466d41cb60e@git.apache.org>
In-Reply-To: <32d78a60f21748bcac12b0b86e78ed26@git.apache.org>
References: <32d78a60f21748bcac12b0b86e78ed26@git.apache.org>
X-Mailer: ASF-Git Admin Mailer
Subject: [10/20] trafodion-site git commit: Merge [TRAFODION-2973] and
[TRAFODION-2989] PR 1458, PR 1468
http://git-wip-us.apache.org/repos/asf/trafodion-site/blob/758b046e/docs/2.3.0/sql_reference/dependencies.html
----------------------------------------------------------------------
diff --git a/docs/2.3.0/sql_reference/dependencies.html b/docs/2.3.0/sql_reference/dependencies.html
index f3d010a..05d2261 100644
--- a/docs/2.3.0/sql_reference/dependencies.html
+++ b/docs/2.3.0/sql_reference/dependencies.html
@@ -1,5 +1,5 @@
-
+
@@ -10,7 +10,7 @@
@import url("./css/site.css");
-
+
@@ -27,7 +27,7 @@
- Last Published: 2018-03-18
+ Last Published: 2018-03-20
| Version: 2.3.0
Trafodion SQL Reference Manual
http://git-wip-us.apache.org/repos/asf/trafodion-site/blob/758b046e/docs/2.3.0/sql_reference/index.html
----------------------------------------------------------------------
diff --git a/docs/2.3.0/sql_reference/index.html b/docs/2.3.0/sql_reference/index.html
index 4e28037..a31a1bf 100644
--- a/docs/2.3.0/sql_reference/index.html
+++ b/docs/2.3.0/sql_reference/index.html
@@ -9040,6 +9040,346 @@ CREATE TABLE t2 (c1 int, c2 char (50) UPSHIFT NOT NULL) AS SELECT * FROM t1;
+
+
Examples of CREATE EXTERNAL TABLE
+
+
This example compares the execution time of using external table and not using external table when reading hive tables.
+
+
+
The former takes less time than the latter, since the trafodion external table supplies upper bounds for varchar lengths, which may lead to better plans and/or run-time behavior.
+
+
+
+
+
+
+
+
+Either running UPDATE STATISTICS or using a trafodion external table may improve performance. To get full performance benefit, you must run UPDATE STATISTICS and use the trafodion external table.
+
+
+
+
+
+
This is the definition of the hive tabletest_mix which has a trafodion external table, the size is 137.6G.
SELECT [LAST 1] * FROM hive.hive.test_mix WHERE mix_other02 = 'Ot';
+
+
+
+
it takes approximately 6 minutes (average value) to get the result using the trafodion external table.
+
+
+
+
+
+
+
+
+
+
+
+
+
First Result
+
Second Result
+
Third Result
+
Average Value
+
+
+
+
+
Start Time
+
2018/03/07 18:40:31.655159
+
2018/03/07 09:37:50.801345
+
2018/03/07 09:45:05.921706
+
+
+
+
End Time
+
2018/03/07 18:49:08.879780
+
2018/03/07 09:43:16.695492
+
2018/03/07 09:48:58.251764
+
+
+
+
Elapsed Time
+
2018/03/07 00:08:37.224621
+
2018/03/07 00:05:25.894147
+
2018/03/07 00:03:52.330058
+
00:06:12.23
+
+
+
Compile Time
+
2018/03/07 00:00:03.497624
+
2018/03/07 00:00:11.595054
+
2018/03/07 00:00:00.551781
+
00:00:04.8
+
+
+
Execution Time
+
2018/03/07 00:08:33.715742
+
2018/03/07 00:05:14.295840
+
2018/03/07 00:03:51.708673
+
00:06:12
+
+
+
+
+
while it takes approximately 14 minutes (average value) to get the result without using the trafodion external table.
+
+
+
+
+
+
+
+
+
+
+
+
+
First Result
+
Second Result
+
Third Result
+
Average Value
+
+
+
+
+
Start Time
+
2018/03/07 13:33:46.722646
+
2018/03/07 14:39:30.323730
+
2018/03/07 14:54:58.177258
+
+
+
+
End Time
+
2018/03/07 13:48:35.028916
+
2018/03/07 14:53:53.887911
+
2018/03/07 15:09:11.517646
+
+
+
+
Elapsed Time
+
2018/03/07 00:14:48.306270
+
2018/03/07 00:14:23.564181
+
2018/03/07 00:14:13.340388
+
00:14:28.40
+
+
+
Compile Time
+
2018/03/07 00:00:00.773770
+
2018/03/07 00:00:00.388777
+
2018/03/07 00:00:14.856643
+
00:00:04
+
+
+
Execution Time
+
2018/03/07 00:14:47.530017
+
2018/03/07 00:14:23.146420
+
2018/03/07 00:13:58.463850
+
00:13:58
+
+
+
+
+
+
When executing the following query:
+
+
+
SELECT [LAST 1] mix_other02, substring(mix_other12 from 1 for 10) FROM hive.hive.test_mix WHERE substring(mix_other02 from 1 for 1) = 'O';
+
+
+
+
it takes approximately 6 minutes (average value) to get the result using the trafodion external table.
+
+
+
+
+
+
+
+
+
+
+
+
+
First Result
+
Second Result
+
Third Result
+
Average Value
+
+
+
+
+
Start Time
+
2018/03/09 14:07:59.353015
+
2018/03/09 14:16:27.725035
+
2018/03/09 14:41:01.454408
+
+
+
+
End Time
+
2018/03/09 14:15:05.979546
+
2018/03/09 14:20:44.939776
+
2018/03/09 14:46:58.238246
+
+
+
+
Elapsed Time
+
2018/03/09 00:07:06.626531
+
2018/03/09 00:04:17.214741
+
2018/03/09 00:05:56.783838
+
00:05:59
+
+
+
Compile Time
+
2018/03/09 00:00:00.197789
+
2018/03/09 00:00:00.296705
+
2018/03/09 00:00:00.227511
+
00:00:00.23
+
+
+
Execution Time
+
2018/03/09 00:07:06.411065
+
2018/03/09 00:04:16.873090
+
2018/03/09 00:05:56.554411
+
00:05:59
+
+
+
+
+
while it takes approximately 35 minutes (average value) to get the result without using the trafodion external table.
+
+
+
+
+
+
+
+
+
+
+
+
+
First Result
+
Second Result
+
Third Result
+
Average Value
+
+
+
+
+
Start Time
+
2018/03/09 11:01:12.676307
+
2018/03/09 11:35:54.514479
+
2018/03/09 13:15:07.006658
+
+
+
+
End Time
+
2018/03/09 11:35:16.264756
+
2018/03/09 12:11:09.587147
+
2018/03/09 13:49:23.740406
+
+
+
+
Elapsed Time
+
2018/03/09 00:34:03.588449
+
2018/03/09 00:35:15.072668
+
2018/03/09 00:34:16.733748
+
34:44:00
+
+
+
Compile Time
+
2018/03/09 00:00:00.703053
+
2018/03/09 00:00:00.280146
+
2018/03/09 00:00:00.536929
+
00:00:00.5
+
+
+
Execution Time
+
2018/03/09 00:34:02.828529
+
2018/03/09 00:35:14.743914
+
2018/03/09 00:34:16.155336
+
34:44:00
+
+
+
+
+
+
+
+
@@ -14055,7 +14395,7 @@ evaluation of query expressions, or joined tables.
query-specification is:
[with-clause]
-SELECT [ "[" ANY N "]" | "[" FIRST N "]" ] [ALL | DISTINCT] select-list
+SELECT [ "[" ANY N "]" | "[" FIRST N "]" | "[" LAST N "]" ] [ALL | DISTINCT] select-list
FROM table-ref [,table-ref]...
[WHERE search-condition]
[SAMPLE sampling-method]
@@ -14219,14 +14559,14 @@ transpose-item-list is:
-
"[" ANY N "]" | "[" FIRST N "]"
+
`"[" ANY N "]" | "[" FIRST N "]" | "[" LAST N "]" `
specifies that N rows are to be returned (assuming the table has at least N rows and that the qualification
criteria specified in the WHERE clause, if any, would select at least N rows) and you do not care which N rows
are chosen (out of the qualified rows) to actually be returned.
-
You must enclose ANY N or FIRST N in square brackets ([]). The quotation marks ("") around each square bracket in
+
You must enclose ANY N, FIRST N or LAST N in square brackets ([]). The quotation marks ("") around each square bracket in
the syntax diagram indicate that the bracket is a required character that you must type as shown (for example, [ANY 10]
or [FIRST 5]). Do not include quotation marks in ANY or FIRST clauses.
@@ -14236,6 +14576,9 @@ result table of the SELECT statement. N is an unsigned numeric literal
of rows in the table, all rows are returned. [ANY N] and [FIRST N] are disallowed in nested SELECT statements and on
either side of a UNION operation.
+
+
[LAST N] performs the entire query and calculates elapsed time. The N must be 0 or 1. [LAST 0] does not return any rows. [LAST 1] returns only the last qualified row.
+
ALL | DISTINCT
@@ -15989,6 +16332,35 @@ SELECT a+1 FROM t GROUP BY 1+a;
SQL>SELECT [LAST 2] * FROM employee;
+
+*** ERROR[15002] Internal parser error: Number of rows must be 0 or 1 with LAST option.
+. [2018-02-28 18:05:12]