I am currently working on a query optimization which is taking a long time to run. When I googled it I found that we can check the query performance by using sql Explain Plan, below is the plan I got for my query but I am unable to understand what exactly what it says.!
SELECT STATEMENT ALL_ROWS Cost: 13 Bytes: 187 Cardinality: 1
15 NESTED LOOPS Cost: 13 Bytes: 187 Cardinality: 1
12 NESTED LOOPS Cost: 11 Bytes: 163 Cardinality: 1
9 NESTED LOOPS Cost: 10 Bytes: 146 Cardinality: 1
6 MERGE JOIN CARTESIAN Cost: 8 Bytes: 59 Cardinality: 1
2 TABLE ACCESS BY INDEX ROWID TABLE QUAD.GROUP_ Cost: 4 Bytes: 27 Cardinality: 1
1 INDEX SKIP SCAN INDEX (UNIQUE) QUAD.IX_5BDDB872 Cost: 3 Cardinality: 1
5 BUFFER SORT Cost: 4 Bytes: 32 Cardinality: 1
4 TABLE ACCESS BY INDEX ROWID TABLE QUAD.USER_ Cost: 4 Bytes: 32 Cardinality: 1
3 INDEX SKIP SCAN INDEX (UNIQUE) QUAD.IX_C5806019 Cost: 3 Cardinality: 1
8 TABLE ACCESS BY INDEX ROWID TABLE QUAD.IGIMAGE Cost: 2 Bytes: 87 Cardinality: 1
7 INDEX RANGE SCAN INDEX QUAD.IX_BE79E1E1 Cost: 1 Cardinality: 1
11 TABLE ACCESS BY INDEX ROWID TABLE QUAD.IGFOLDER Cost: 1 Bytes: 17 Cardinality: 1
10 INDEX UNIQUE SCAN INDEX (UNIQUE) QUAD.SYS_C00117581 Cost: 0 Cardinality: 1
14 TABLE ACCESS BY INDEX ROWID TABLE QUAD.IMAGE Cost: 2 Bytes: 24 Cardinality: 1
13 INDEX UNIQUE SCAN INDEX (UNIQUE) QUAD.SYS_C00117585 Cost: 1 Cardinality: 1
Please let me know how it works and is there anything wrong with this output?
select ig.largeimageid, ig.groupId, ig.createDate, ig.modifiedDate, ig.folderId, ig.name, ig.imageid,
ig.description, im.type_, im.height, im.width, im.size_,
g.name groupname, u.screenname cecuserid, u.firstname, u.lastname,
fo.name folderName, fo.description folderDesc
from quad.igimage ig,quad.image im, quad.group_ g, quad.user_ u, quad.igfolder fo
where ig.groupid= g.groupid
and u.userid = ig.userid
and fo.folderid=ig.folderid
and ig.largeimageid= im.imageid
and u.screenname='xyz'
and g.friendlyurl = '/xyz';