Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Difference between Create table Statements - response (3) by dnoeth

$
0
0
Did you check the actual resource usage in DBQL? Whenever i did it was the same CPU/IOs for both versions. Of course, there might be differences, but in most cases it could be explained by SET vs. MULTISET or different PIs because they forgot about it.   If you look at Explain, both are quite similar, but for permanentt tables there's one significant difference: CREATE TABLE AS SELECT first merges the data and then creates the table header, so it's only visible when it's finished. That's why i prefer #1, you can see the table grow in dbc.TablesSizeV (or do a COUNT(*) with ACCESS LOCK) and you get better control over the DDL. I usually prefer to do a CREATE TABLE AS SELECT WITH NO DATA, followed by a SHOW TABLE. Then i modify the DDL to my needs and use this. I mainly do #2 for SPs with Dynamic SQL, when i really don't know about the definition in advance.      And if there actually was a more efficient way to do the insert in one of the cases why use a slower implementation in the other case? Dieter   

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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