I have a query that runs very slow, its:
select distinct arbeidsoppgaver.godkjent, arbeidsoppgaver.tilredaktor,
arbeidsoppgaver.oppgave, arbeidsoppgaver.aid, arbeidsoppgaver.arbinfo,
tider.bdato, arbeidsoppgaver.link, tider.fdato, tider.ftid,
tider.bekreftelse from arbeidsoppgaver, tider, ttilg where (tider.aid =
arbeidsoppgaver.aid and tider.tid in (select tid from ttilb where bid =
103)) or (tider.aid = arbeidsoppgaver.aid and ttilg.tid = tider.tid and
ttilg.gid in (select gid from btilg where bid = 103))
But when i only use one part of the where clause, dont mather which, it
runs fast:
select distinct arbeidsoppgaver.godkjent, arbeidsoppgaver.tilredaktor,
arbeidsoppgaver.oppgave, arbeidsoppgaver.aid, arbeidsoppgaver.arbinfo,
tider.bdato, arbeidsoppgaver.link, tider.fdato, tider.ftid,
tider.bekreftelse from arbeidsoppgaver, tider, ttilg where (tider.aid =
arbeidsoppgaver.aid and tider.tid in (select tid from ttilb where bid =
103))
Anyone know why?
Best Regards
Andreas Aulin
Norway