Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
d2847f76
Commit
d2847f76
authored
10 years ago
by
Sebastien Ponce
Browse files
Options
Downloads
Patches
Plain Diff
Extra optimization hints for the SQL select behind stager_qry
parent
1efeb890
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
castor/db/oracleQuery.sql
+19
-17
19 additions, 17 deletions
castor/db/oracleQuery.sql
with
19 additions
and
17 deletions
castor/db/oracleQuery.sql
+
19
−
17
View file @
d2847f76
...
...
@@ -73,20 +73,20 @@ BEGIN
AND
(
euid
=
0
OR
SvcClass
.
id
IS
NULL
OR
-- if euid > 0 check read permissions for srmLs (see bug #69678)
checkPermission
(
SvcClass
.
name
,
euid
,
egid
,
35
)
=
0
)
-- OBJ_StageGetRequest
UNION
ALL
SELECT
/*+ LEADING(cfidTable DiskCopy DataPool2SvcClass SvcClass DataPool)
USE_NL(cfidTable DiskCopy DataPool2SvcClass SvcClass DataPool) */
SELECT
/*+ LEADING(cfidTable DiskCopy DataPool2SvcClass SvcClass DataPool DiskServer)
USE_NL(cfidTable DiskCopy DataPool2SvcClass SvcClass DataPool DiskServer)
INDEX_RS_ASC(DiskCopy I_DiskCopy_CastorFile) */
DiskCopy
.
id
,
DiskCopy
.
path
,
DiskCopy
.
status
,
DataPool
.
name
AS
machine
,
''
AS
mountPoint
,
SvcClass
.
name
AS
svcClass
,
DiskCopy
.
castorFile
,
DiskCopy
.
nbCopyAccesses
,
DiskCopy
.
creationTime
,
DiskCopy
.
lastAccessTime
,
0
AS
isOnDrainingHardware
FROM
DataPool2SvcClass
,
DataPool
,
SvcClass
,
DiskCopy
FROM
DataPool2SvcClass
,
DataPool
,
SvcClass
,
DiskCopy
,
DiskServer
WHERE
Diskcopy
.
castorFile
IN
(
SELECT
/*+ CARDINALITY(cfidTable 5) */
*
FROM
TABLE
(
cfs
)
cfidTable
)
AND
Diskcopy
.
status
IN
(
0
,
1
,
4
,
5
,
6
,
7
,
10
,
11
)
-- search for diskCopies not BEINGDELETED
AND
EXISTS
(
SELECT
1
FROM
DiskServer
WHERE
DiskServer
.
dataPool
=
DiskCopy
.
dataPool
AND
DiskServer
.
status
IN
(
dconst
.
DISKSERVER_PRODUCTION
,
dconst
.
DISKSERVER_DRAINING
,
dconst
.
DISKSERVER_READONLY
)
AND
DiskServer
.
hwOnline
=
1
)
AND
DiskServer
.
dataPool
=
DiskCopy
.
dataPool
AND
DiskServer
.
status
IN
(
dconst
.
DISKSERVER_PRODUCTION
,
dconst
.
DISKSERVER_DRAINING
,
dconst
.
DISKSERVER_READONLY
)
AND
DiskServer
.
hwOnline
=
1
AND
DataPool2SvcClass
.
parent
=
Diskcopy
.
dataPool
AND
SvcClass
.
id
=
DataPool2SvcClass
.
child
AND
(
euid
=
0
OR
-- if euid > 0 check read permissions for srmLs (see bug #69678)
...
...
@@ -161,18 +161,20 @@ BEGIN
AND
nvl
(
DiskServer
.
hwOnline
,
1
)
=
1
AND
DiskPool2SvcClass
.
parent
(
+
)
=
FileSystem
.
diskPool
UNION
ALL
SELECT
DiskCopy
.
id
,
DiskCopy
.
path
,
DiskCopy
.
status
,
DataPool
.
name
AS
machine
,
''
AS
mountPoint
,
SELECT
/*+ LEADING(cfidTable DiskCopy DataPool2SvcClass DataPool DiskServer)
USE_NL(cfidTable DiskCopy DataPool2SvcClass DataPool DiskServer)
INDEX_RS_ASC(DiskCopy I_DiskCopy_CastorFile) */
DiskCopy
.
id
,
DiskCopy
.
path
,
DiskCopy
.
status
,
DataPool
.
name
AS
machine
,
''
AS
mountPoint
,
DataPool2SvcClass
.
child
AS
dcSvcClass
,
DiskCopy
.
castorFile
,
DiskCopy
.
nbCopyAccesses
,
DiskCopy
.
creationTime
,
DiskCopy
.
lastAccessTime
,
0
AS
isOnDrainingHardware
FROM
DataPool2SvcClass
,
DataPool
,
DiskCopy
FROM
DataPool2SvcClass
,
DataPool
,
DiskCopy
,
DiskServer
WHERE
Diskcopy
.
castorFile
IN
(
SELECT
/*+ CARDINALITY(cfidTable 5) */
*
FROM
TABLE
(
cfs
)
cfidTable
)
AND
DiskCopy
.
status
IN
(
0
,
1
,
4
,
5
,
6
,
7
,
10
,
11
)
-- search for diskCopies not GCCANDIDATE or BEINGDELETED
AND
EXISTS
(
SELECT
1
FROM
DiskServer
WHERE
DiskServer
.
dataPool
=
DiskCopy
.
dataPool
AND
DiskServer
.
status
IN
(
dconst
.
DISKSERVER_PRODUCTION
,
dconst
.
DISKSERVER_DRAINING
,
dconst
.
DISKSERVER_READONLY
)
AND
DiskServer
.
hwOnline
=
1
)
AND
DiskServer
.
dataPool
=
DiskCopy
.
dataPool
AND
DiskServer
.
status
IN
(
dconst
.
DISKSERVER_PRODUCTION
,
dconst
.
DISKSERVER_DRAINING
,
dconst
.
DISKSERVER_READONLY
)
AND
DiskServer
.
hwOnline
=
1
AND
DataPool2SvcClass
.
parent
=
DiskCopy
.
dataPool
AND
DataPool
.
id
=
Diskcopy
.
dataPool
)
DC
-- No extra check on read permissions here, it is not relevant
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment