Use of indexing in searching

Saima Jelani

Use of indexing in searching
Hello
i have created a table which have 3 columns (sk1,sk2,sk3). These
columns contains the search key words . After table creation i have
created index on these 3 search keys.Now i want to match match the
column of one table say tab1 with all these search keys of tab2 using
SQL query. Now i want to know whats the use of setting index on these
colunm, will this improve the serach speed or any thing like that. Or if
not whats the use of setting index on cols. There will be many records
in tab2 and i want the results quickly.

Plaese reply me as soon as possible
thnaks in advance



Georg Peter

AW: Use of indexing in searching
(in response to Saima Jelani)
What's about the following:

select b.sk1
b.sk2
b.sk3
from yourtable1 a
, yourtable2 b
where a.sk1 = b.sk1
and a.sk2 = b.sk2
and a.sk3 = b.sk3

Assuming both tables contain enough rows for an index access you may create
this index on both tables. And if the friendly DB2 optimizer decides to use
both indexes this will improve the search speed....

With kind regards - mit freundlichen Gruessen,
Georg H. Peter
----------------------------------------------------------------------


-----Ursprüngliche Nachricht-----
Von: saima [mailto:[login to unmask email]
Gesendet am: Donnerstag, 12. Dezember 2002 12:05
An: [login to unmask email]
Betreff: Use of indexing in searching

Hello
i have created a table which have 3 columns (sk1,sk2,sk3). These
columns contains the search key words . After table creation i have
created index on these 3 search keys.Now i want to match match the
column of one table say tab1 with all these search keys of tab2 using
SQL query. Now i want to know whats the use of setting index on these
colunm, will this improve the serach speed or any thing like that. Or if
not whats the use of setting index on cols. There will be many records
in tab2 and i want the results quickly.

Plaese reply me as soon as possible
thnaks in advance


visit the