Re: Big tables

From: Heinz Huber <Heinz.Huber_at_elbanet.co.at>
Date: 2000/02/17
Message-ID: <38AB9884.63DAE7C6_at_elbanet.co.at>#1/1


Hi!

Raimundo Lozano wrote:
>
> Heinz Huber wrote:
>
> > I think the most important issue in dealing with largly populated tables
> > and also with a big number of joins are indexes. Given good selectivity,
> > the right indexes should speed queries (and joins) up big time.
> >
>
> I agree with you about the utility of indexes. But if you have a join between
> 5 tables, every one with a million of rows, the DBMS have to deal with a
> number of rows of 100000000... until 30 "0s". I think is a number greater than
> the number of atoms in the Universe. I know that the optimizer of the DBMS can
> reduce that number, but do you think that only with right indexes is enough?

That's why I also included the following statement in my reply: <copied from original reply>
Splitting the queries (at least that's what I think you meant by the term sentence) in more than one might help, if you choose the right joins for the intermediate results and if you have indexes on your temporary tables.
<\copied from original reply>

If you chose the joins that reduce the result sets the most, you'll end up with "rather" small intermediate results. Nevertheless you should have indexes on the temp tables for the remaining joins. Actually I think, the optimizer should do this. But sometimes, you'll have to do it yourself to get it done right.

Heinz Received on Thu Feb 17 2000 - 00:00:00 CET

Original text of this message