|
Archives of the TeradataForumMessage Posted: Fri, 25 Nov 2011 @ 09:07:57 GMT
Hi, One possible solutions is: if you had created 6 parts from the original table based on values of a specific column, for example department, you can use that in the view as below. replace view v_large_table as select 1 as department, a.* from large_table_department1 a union all select 2 as department, a.* from large_table_department2 a union all select 3 as department, a.* from large_table_department3 a union all ..... ..... ..... select 6 as department, a.* from large_table_department6 a ; And then, if you use the column department in all queries, Teradata will scan only the specific table based on the satisfiability. (Otherwise it will have scan all 6 tables and do the 'union all' as it may be happening now.) explain select * from v_large_table where department = 2 ; Thanks Jinesh
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||