We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Create Table vs Insert Into /*+direct*/ — Vertica Forum

Create Table vs Insert Into /*+direct*/

Hi,

What is the difference between:

  • create table
  • insert into /+direct/

I did some tests and have difference (dramatic) between above 2 scenarios:

  • create table took abot 700s
  • insert into took about 10000s

I used the same sql statement.

?

Comments

  • I just checked...
    Create table is creating projection with following order and segmentation:

    ORDER BY test_col.col1,
    test_col.col2,
    test_col.col3,
    test_col.col4
    SEGMENTED BY hash(test_col.col1, test_col.col2, test_col.col4, test_col.col3)

    I use col1 as my key in queries, so i thought that it will be the best to order by it (col1). But then it tooks a lot of time...

    So its better to have more columns in order clause ?

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file