I've finally solved my problem.
If I change the optimization level to 0, the query is finnished in 8 seconds.
Thanks everyone for the help.
Lukas Felder
I checked everything I could and now think that I know what the reason is, the query suddenly took so long.
Before I created any indexes, the optimizer uses a NLJOIN for R and S and a MSJOIN for the result of the NLJOIN and and T. For these joins it sorted S on D and didn't have to sort the...
No I haven't tried altering that table.
I was told that the optimizer miscalculates himself and i should look at the system tables. Which system tables do I have to look at to find a solution?
Lukas Felder
No
The query I mentioned above is the only one i've run so far.
I overthought what I wrote earlier, and am not very convinced with that. I don't believe anymore, that the query takes longer because it's larger. It only started to take longer as soon as I used RUNSTATS. If I hadn't used it, I...
thanks for your answers.
Larry: I tried what you suggested. I'm affraid the results weren't very promising. on the contrary, the queries sometimes took even longer to produce the results.
But thank you anyway.
I then looked at the sizes of the tables and indexes, and realized that the indexes...
hi everyone
i'm doing a work on optimizing db-queries.
my test-db has the following tables:
create table r (a int, b int);
create table s (a int, d int, e int),
create table t (d int, f int);
these are filled with 1 million pseudorandom numbers.
my query is as follows:
select *
from r,s,t...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.