IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

on what basis we will say Badly constructed SQL,


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sudheerkmf

New User


Joined: 24 Nov 2006
Posts: 2
Location: Pune

PostPosted: Mon Dec 11, 2006 5:06 pm
Reply with quote

for finding the poor performance.

what basis we will say badly construted Sql
Back to top
View user's profile Send private message
hariavinash

New User


Joined: 04 Jan 2006
Posts: 64

PostPosted: Mon Dec 11, 2006 10:33 pm
Reply with quote

query not optimized based on keys..
table scan..
cartesian product.. are few to start with.

cheers
Back to top
View user's profile Send private message
ravi17s
Warnings : 1

New User


Joined: 15 Aug 2003
Posts: 57

PostPosted: Tue Dec 12, 2006 7:23 pm
Reply with quote

Response Time of the query.

have look ino the Plan table if you have access,check for the attributes like Type of scan,match columns,list prefetch.JOIN METHOD...
sorting requirements.............


Thx,
Ravi.
Back to top
View user's profile Send private message
sudheerkmf

New User


Joined: 24 Nov 2006
Posts: 2
Location: Pune

PostPosted: Wed Dec 13, 2006 4:07 pm
Reply with quote

ravi

how we can look into plan table,
could you please expalin the procedure.

we alreday exected queries in production like withh order, with out order

but we didnt get any differnce in the sql execution time.


thx
sudheer
Back to top
View user's profile Send private message
ravi17s
Warnings : 1

New User


Joined: 15 Aug 2003
Posts: 57

PostPosted: Fri Dec 15, 2006 5:36 pm
Reply with quote

When your are binding the program
will u give an option EXPLAIN(YES)
then thie will populate the values into the plan table.

normally plantable will will be named as

PLAN_TABLE with ur qualified object owner

XXXXXX.PLAN_TABLE
following checklist to see that you have not overlooked some of the basics:
?Is the query coded as simply as possible??
?Are all predicates coded correctly??
?Are there subqueries in your query??
?Does your query involve aggregate functions??
?Do you have an input variable in the predicate of an SQL query??
?Do you have a problem with column correlation??
?Can your query be written to use a noncolumn expression??



Post the query.........Somebody can help you........
Or contact your DBA's
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts JOINKEYS to match two input files on ... DFSORT/ICETOOL 3
No new posts Creation of Datasets dynamically on t... DFSORT/ICETOOL 8
No new posts JCL SORT - GROUP Select on the basis ... JCL & VSAM 15
No new posts Merging 2 lines in one on conditional... DFSORT/ICETOOL 11
No new posts I need to split the file on the basis... DFSORT/ICETOOL 4
Search our Forums:

Back to Top