Discussion:
which fields should have indexes?
(too old to reply)
humanista (mruczus)
2008-07-10 03:58:19 UTC
Permalink
I have a query for a master-detail tables
select a.f1, a.f2, b.f1
from table1 a, table2 b
where a.f3=b.f3
(primary key is connected to foreign key). There is an index on a foreign
key. Should a.f1, a.f2, b.f1 also have indexes?
Bill Todd [TeamB]
2008-07-10 13:50:19 UTC
Permalink
Post by humanista (mruczus)
Should a.f1, a.f2, b.f1 also have indexes?
No. Indexes on fields in the WHERE clause may help performance since
these are the values used to locate the record.
--
Bill Todd (TeamB)
Bill Todd [TeamB]
2008-07-10 13:51:21 UTC
Permalink
Also, when you ask questions please tell us what database you are
using. It usually affects the answer.
--
Bill Todd (TeamB)
Loading...