compound sortkey(f1,f2) ;

Good morning.
In other databases i can use compound sortkey(f1,f2) order this field in vertica ther is something similar.

Thanks.

Comments

  • Hi!

    No, Vertica != RedShift.
  • marcothesanemarcothesane - Select Field - Administrator

    Hi Ismael -
    As sKwa pointed out, Vertica is not RedShift - nor, for that matter are sorted tables a standard in SQL databases.
    It happens so, though, that Vertica is columnar database, and, therefore, its data is always sorted.
    Check out Vertica's documentation on projections . In short, a table can have several projection , each of which stores all or sometimes part of the columns of the anchor table, and each of which can be distributed across the nodes and sorted differently.
    You can specify sorting and distribution at CREATE TABLE time, too; the effect is that the superprojection - the main, default, projection - is created with these parameters.

    Like so:
    CREATE TABLE cust (
    cust_id INT NOT NULL
    , cust_valid DATE NOT NULL
    , cust_name VARCHAR(64)
    , cust_dob DATE
    )
    ORDER BY cust_id,cust_valid
    SEGMENTED BY HASH(cust_id) ALL NODES KSAFE 1;

  • Ismael, our documentation is generally very good, and we have a lot of resources to help you figure things out. That said, I wonder if you wouldn't benefit from some training? My sense is it could save you some time and get you into the swing of working with Vertica.

    https://my.vertica.com/resources/training/

  • Ok ,thank you so much.
    I took 7 days with vertica ,my english no is very good .
    I will try learning fast.

Leave a Comment

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