⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subquery.out

📁 derby database source code.good for you.
💻 OUT
📖 第 1 页 / 共 5 页
字号:
0          |0     |0                             |0                             |0                   1          |1     |1                             |1                             |1                   ij> -- updateupdate u  set i = (select i from s where u.i = s.i)where i = (select i/(i-1) from s where u.i = s.i);ERROR 22012: Attempt to divide by zero.ij> update u  set i = (select i/i-1 from s where u.i = s.i)where i = (select i from s where u.i = s.i);ERROR 22012: Attempt to divide by zero.ij> select * from u;I          |S     |C                             |VC                            |B                   -----------------------------------------------------------------------------------------------------NULL       |NULL  |NULL                          |NULL                          |NULL                0          |0     |0                             |0                             |0                   1          |1     |1                             |1                             |1                   ij> -- error in nested subqueryselect (select (select (select i from s) from s) from s) from s;ERROR 21000: Scalar subquery is only allowed to return a single row.ij> -- do consistency check on scans, etc.values ConsistencyChecker();1                                                                                                                               --------------------------------------------------------------------------------------------------------------------------------No open scans, etc.2 dependencies found                                                                                        ij> -- reset autocommitautocommit on;ij> -- drop the tablesdrop table li;0 rows inserted/updated/deletedij> drop table s;0 rows inserted/updated/deletedij> drop table t;0 rows inserted/updated/deletedij> drop table tt;0 rows inserted/updated/deletedij> drop table ttt;0 rows inserted/updated/deletedij> drop table u;0 rows inserted/updated/deletedij> -- DERBY-1007: Optimizer for subqueries can return incorrect cost estimates-- leading to sub-optimal join orders for the outer query.  Before the patch-- for that isssue, the following query plan will show T3 first and then T1---- but that's determined by the optimizer to be the "bad" join order.  After-- the fix, the join order will show T1 first, then T3, which is correct-- (based on the optimizer's estimates).create table t1 (i int, j int);0 rows inserted/updated/deletedij> insert into T1 values (1,1), (2,2), (3,3), (4,4), (5,5);5 rows inserted/updated/deletedij> create table t3 (a int, b int);0 rows inserted/updated/deletedij> insert into T3 values (1,1), (2,2), (3,3), (4,4);4 rows inserted/updated/deletedij> insert into t3 values (6, 24), (7, 28), (8, 32), (9, 36), (10, 40);5 rows inserted/updated/deletedij> call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);0 rows inserted/updated/deletedij> maximumdisplaywidth 20000;ij> select x1.j, x2.b from  (select distinct i,j from t1) x1,  (select distinct a,b from t3) x2where x1.i = x2.aorder by x1.j, x2.b;J          |B          -----------------------1          |1          2          |2          3          |3          4          |4          ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Statement Name: 	nullStatement Text: 	select x1.j, x2.b from  (select distinct i,j from t1) x1,  (select distinct a,b from t3) x2where x1.i = x2.aorder by x1.j, x2.bParse Time: 0Bind Time: 0Optimize Time: 0Generate Time: 0Compile Time: 0Execute Time: 0Begin Compilation Timestamp : nullEnd Compilation Timestamp : nullBegin Execution Timestamp : nullEnd Execution Timestamp : nullStatement Execution Plan Text: Sort ResultSet:Number of opens = 1Rows input = 4Rows returned = 4Eliminate duplicates = falseIn sorted order = falseSort information: 	Number of rows input=4	Number of rows output=4	constructor time (milliseconds) = 0	open time (milliseconds) = 0	next time (milliseconds) = 0	close time (milliseconds) = 0Source result set:	Project-Restrict ResultSet (5):	Number of opens = 1	Rows seen = 4	Rows filtered = 0	restriction = false	projection = true		constructor time (milliseconds) = 0		open time (milliseconds) = 0		next time (milliseconds) = 0		close time (milliseconds) = 0		restriction time (milliseconds) = 0		projection time (milliseconds) = 0	Source result set:		Nested Loop Join ResultSet:		Number of opens = 1		Rows seen from the left = 5		Rows seen from the right = 4		Rows filtered = 0		Rows returned = 4			constructor time (milliseconds) = 0			open time (milliseconds) = 0			next time (milliseconds) = 0			close time (milliseconds) = 0		Left result set:			Distinct Scan ResultSet for T1 using index xxxxFILTERED-UUIDxxxx at read committed isolation level using instantaneous share row locking: 			Number of opens = 1			Hash table size = 5			Distinct columns are column numbers (0,1)			Rows seen = 5			Rows filtered = 0				constructor time (milliseconds) = 0				open time (milliseconds) = 0				next time (milliseconds) = 0				close time (milliseconds) = 0				next time in milliseconds/row = 0			scan information: 				Bit set of columns fetched=All				Number of columns fetched=2				Number of pages visited=1				Number of rows qualified=5				Number of rows visited=5				Scan type=heap				start position:	None				stop position:	None				scan qualifiers:None				next qualifiers:None		Right result set:			Project-Restrict ResultSet (4):			Number of opens = 5			Rows seen = 45			Rows filtered = 41			restriction = true			projection = true				constructor time (milliseconds) = 0				open time (milliseconds) = 0				next time (milliseconds) = 0				close time (milliseconds) = 0				restriction time (milliseconds) = 0				projection time (milliseconds) = 0			Source result set:				Distinct Scan ResultSet for T3 using index xxxxFILTERED-UUIDxxxx at read committed isolation level using instantaneous share row locking: 				Number of opens = 5				Hash table size = 9				Distinct columns are column numbers (0,1)				Rows seen = 45				Rows filtered = 0					constructor time (milliseconds) = 0					open time (milliseconds) = 0					next time (milliseconds) = 0					close time (milliseconds) = 0					next time in milliseconds/row = 0				scan information: 					Bit set of columns fetched=All					Number of columns fetched=2					Number of pages visited=1					Number of rows qualified=9					Number of rows visited=9					Scan type=heap					start position:	None					stop position:	None					scan qualifiers:None					next qualifiers:Noneij> -- clean up.call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(0);0 rows inserted/updated/deletedij> drop table t1;0 rows inserted/updated/deletedij> drop table t3;0 rows inserted/updated/deletedij> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -