|
|
Archives of the TeradataForum
Message Posted: Tue, 27 Nov 2012 @ 12:35:55 GMT
Subj: | | Re: Doubt with indexes |
|
From: | | Kenneth Hansen |
Maria,
when your SQL fails to state specific dates but simply the parameters, e.g. using BETWEEN or < >, the Teradata does not know how many dates
there are and appears to need to identify them. I suggest you join the main query to a smaller query identifying the dates and think the source
you want is SYS_CALENDAR - please check that. Give both the table and the query an alias e.g. t1 & t2
SELECT * FROM FINA_BORRAR t1
Inner join
(SELECT DATE from SYS_CALENDAR WHERE DATE BETWEEN ( x , y )) t2
On t1 fec_inicio_vigencia = t2.DATE)
;
This should result in t2, the list of valid dates, being replicated across all amps for a join which is far more efficient than a row by
row read and comparison of fec_inicio_vigencia with your parameters.
Kenneth Hansen
| |