Insert select doesn't insert data in the right order
I am noticing some discrepancies with the way vertica is performing an insert select. I have a table with 3 columns with the data types defined as (identity(1), int, varchar). I am trying to insert data into this table by doing an insert (col2,col3) select col1, col2 from source_table order by col1,col2. After the insert if I run a select * from target_Table order by 1,2 the data seems to be out of order. I also tried running insert into target_Table (col2, col3) select * from (select col1,col2 from source_table) x order by x.col1, x.col2 but still no luck. This is a 3 node cluster and it seems like there were 3 sessions used to insert data into the target table as there 3 sets of caches. I checked this by repeating the exercise with the default value of the cache (250,000). I noticed there were 3 different set of values for the identity column (1,2,3) , (250001, 250002...) and (500001, 500002..). I would assume it would insert rows in one session and just increment the identity column by 1 for each row its trying to insert. FYI, I also tried to do the same thing with sequences and used nextval as the default value. Same behavior (Kinda expected but I was still trying my luck). Is this expected behavior or am I doing something wrong here?
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.