Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Volatile Table In View ?? - forum topic by taruntrehan

$
0
0

Hi,
I am writing a view within which i have some restriction to apply.
Following is my current working query :

REPLACE VIEW person_view
AS LOCKING ROW FOR ACCESS

SELECT distinct
date_time ,
person_id ,
person_key ,
name ,
address 

FROM _person a 

inner join 

(select max(date_time) as max_date_time , person_id as max_person_id , person_key as max_person_key 
from _person group by max_person_id , max_person_key) b

on a.date_time = b.max_date_time
and a.person_id = b.max_person_id
and a.person_key = b.max_person_key;

 

The above query works but i am not sure about:

  1. Performance of the query ?
  2. Is there a possibility to create a volatile table. It should be better as its indexed.
  3. How does TERADATA handle the inner table ?

 
Appreciate your inputs.

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>