Home > database >  A select statement to the oracle database temporary space is growing
A select statement to the oracle database temporary space is growing

Time:11-06

Recently met a strange question an SQL statement in oracle temporary table space growing

SQL below
 
Select the UI. *, ud. DepId as departmentDn, di. Name department
The from user_info UI,
User_department ud,
Org_department od,
Department_info di
Where UI. Userid=ud. Userid
And di. Id=ud. DepId
And ud. DepId=od. DepId
And od. Dimension='2 d8794ab77cb4e5a9bbe807da6ce90b2';


Delete the last won't appear the where condition
 
Select the UI. *, ud. DepId as departmentDn, di. Name department
The from user_info UI,
User_department ud,
Org_department od,
Department_info di
Where UI. Userid=ud. Userid
And di. Id=ud. DepId
And ud. DepId=od. DepId



Feelings may and database configuration, can you help me to provide the positioning problem of thinking

CodePudding user response:

The execution plan to see

CodePudding user response:

 
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| | Id Operation | Name | Rows | Bytes | Cost (% CPU) | Time |
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
| | 0 SELECT STATEMENT | | 1 8 (0) | | 495 | 00:00:01 |
| * 1 | HASH JOIN | | 1 8 (0) | | 495 | 00:00:01 |
| 2 | MEGGE JOIN CARTESIAN | | 6 6 (0) | | 2190 | 00:00:01 |
2 | 3 | MEGGE JOIN CARTESIAN | | | 580 | 4 (0) | 00:00:01 |
| | * 4 TABLE ACCESS FULL | ORG_DEPARTMENT 2 (0) | | 130 | | 1 00:00:01 |
| | 5 BUFFER SORT | | | 640 | 2 (0) | 00:00:01 |
| | 6 TABLE ACCESS FULL | USER_INFO 2 (0) | | 640 | | 4 00:00:01 |
7 | | BUFFER SORT | 225 | | 3 | 4 (0) | 00:00:01 |
| | 8 TABLE ACCESS FULL | DEPARTMENT_INFO | 3 | 225 | 1 (0) | 00:00:01 |
| | 9 TABLE ACCESS FULL | USER_DEPARTMENT 2 (0) | | 650 | | 5 00:00:01 |
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

The Predicate Information (identified by operation id) :
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

1 - access (" UI ". "USERID"="UD". "USERID" AND "DI". "ID"="UD". "DEPID AND
""UD". "DEPID"="OD". "DEPID")
4 - filter (" OD ". "DIMENSION"=U '2 d8794ab77cb4e5a9bbe807da6ce90b2'
  • Related