J
Jim
I have two HUGE tables that don't have keys but are indexed (Yes
(Duplicates OK)) on the fields I use for the join and select. There's
no keys because these are imported tables and I'm only doing reports off
the tables. No maintenance or updates will be done to the them. If I
run queries against the individual tables they scream (go fast). If I
join the two and query, they run forever. Its like they're doing a
table scan - looking for each record.
The two tables are in separate db's. I'm running A2K on Win XP Pro.
Screams:
SELECT clmhdr.chclno, clmhdr.chwkno, clmhdr.chinfr
FROM clmhdr
WHERE (((clmhdr.chclno)=4) AND ((clmhdr.chwkno)=1));
Screams:
SELECT clmdet.cdclno, clmdet.cdwkno, clmdet.cdlnno
FROM clmdet
WHERE (((clmdet.cdclno)=4) AND ((clmdet.cdwkno)=1));
Dies:
SELECT clmhdr.chclno, clmhdr.chwkno, clmhdr.chinfr, clmdet.cdlnno
FROM clmhdr INNER JOIN clmdet ON (clmhdr.chwkno = clmdet.cdwkno) AND
(clmhdr.chclno = clmdet.cdclno)
WHERE (((clmhdr.chclno)=4) AND ((clmhdr.chwkno)=1));
TIA
Jim
(Duplicates OK)) on the fields I use for the join and select. There's
no keys because these are imported tables and I'm only doing reports off
the tables. No maintenance or updates will be done to the them. If I
run queries against the individual tables they scream (go fast). If I
join the two and query, they run forever. Its like they're doing a
table scan - looking for each record.
The two tables are in separate db's. I'm running A2K on Win XP Pro.
Screams:
SELECT clmhdr.chclno, clmhdr.chwkno, clmhdr.chinfr
FROM clmhdr
WHERE (((clmhdr.chclno)=4) AND ((clmhdr.chwkno)=1));
Screams:
SELECT clmdet.cdclno, clmdet.cdwkno, clmdet.cdlnno
FROM clmdet
WHERE (((clmdet.cdclno)=4) AND ((clmdet.cdwkno)=1));
Dies:
SELECT clmhdr.chclno, clmhdr.chwkno, clmhdr.chinfr, clmdet.cdlnno
FROM clmhdr INNER JOIN clmdet ON (clmhdr.chwkno = clmdet.cdwkno) AND
(clmhdr.chclno = clmdet.cdclno)
WHERE (((clmhdr.chclno)=4) AND ((clmhdr.chwkno)=1));
TIA
Jim