|
|
Archives of the TeradataForum
Message Posted: Wed, 07 Oct 2009 @ 11:37:05 GMT
Subj: | | Re: Skewness problem in query. |
|
From: | | Victor Sokovin |
| But we have a column, say colx (not part of PI), on which we have to join these tables. Table A has around half of values of colx as
default value (say 999) (no of records having this value are around 1 million ). And table B has just one value as 999 for this joining column
colx. | |
| So when tables are joined on colx, there is going to be high skewness during join as all these one million rows are gonig to be on same
AMP. | |
Only if the optimizer decides to use Table B as base, which in this case seems like an obviously bad choice.
I read this as though Table A has 2 million rows. What about the size of Table B? Sounds like it might be a small reference table but you did
not confirm it. Stats collected on Table B as well?
And the rest of the query? Does it have more tables in it that may confuse the optimizer?
If you've done all the obvious things and the execution plan still remains bad, try to drop all stats and rerun the query. There are cases when
this can lead to better results.
Victor
| |