select /*+Index(table1,t1indexname)*/ col1 from table;
But in DB2 I am not able to understand how to apply hints.
Please give me some example for my reference.
I wanted to use index hint in db2 for a select query.
There are no hints in db2. DB2 generally does an excellent job in choosing a sufficiently good access plan. If everything else fails you can use an optimization profile to influence the optimizer, but in your case it is probably sufficient to update statistics on the table:
runstats on table ... with distribution and sampled detailed indexes all
is the default if you automate runstats, and what I would start with. If runstats alone does not solve the problem have a look at statistical views and optimization level.
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be