Default segmentation behavior differs in Create Table and Create Projection?
Hi - I am trying to understand how Vertica handles "segmentation" option if I don't specify one. The problem I have is - our application generates DDLs on the fly (programatically). I am trying to find out what is a good policy to implement for medium and small workloads. By policy I mean whether our Application specifies how to segment on what column to what nodes, vs. leave everything to Vertica server.
What I found out so far seems to suggest that -
1. Without a "segmented by" or "unsegmented" clause, the create TABLE statement will create a Segmented superprojection on all nodes.
2. However, if I create a similar projection (e.g. select * from table_x order by) without the segmentation option, the create PROJECTION statement will create a non-segmented on all nodes.
Is this the expected behavior? I did read both the Admin and SQLRef portion but didn't find an answer. A colleague read somewhere that if we don't specify the segmentation option, Vertica may add one if the table is too large. Is that so?
Thanks,
Bing
What I found out so far seems to suggest that -
1. Without a "segmented by" or "unsegmented" clause, the create TABLE statement will create a Segmented superprojection on all nodes.
2. However, if I create a similar projection (e.g. select * from table_x order by) without the segmentation option, the create PROJECTION statement will create a non-segmented on all nodes.
Is this the expected behavior? I did read both the Admin and SQLRef portion but didn't find an answer. A colleague read somewhere that if we don't specify the segmentation option, Vertica may add one if the table is too large. Is that so?
Thanks,
Bing
0
Comments
You can supply the segmentation clause in the create table statement if you want.
https://my.vertica.com/docs/6.1.x/HTML/index.htm#1293.htm
You can find the following information on default segmentation strategies, here:
https://my.vertica.com/docs/6.1.x/HTML/index.htm#1293.htm
(scroll down to "Characteristics of default automatic projections")
Bottom line is - it's rarely a good idea to allow the defaults define your physical schema. It's fine in isolation, but tables that are joined together, that have differing segmentation values will not join as efficiently as they could if they were the same. So it's definitely worth taking the time to define a cohesive strategy up front.
>It is a superprojection.
>It uses the default encoding-type AUTO.
>If created as a result of a CREATE TABLE AS SELECT statement, uses the encoding specified in the query table.
>Auto-projections use hash segmentation.
......
two questions:
1 if anyone can change the default charater? for example, change the default automatic projection to unsegmented. if have, how to change it?
2 in the future version, if Vertica will stick to these default charaters
For DBD:
you can run "select disable_elastic_cluster()". In this case DBD will create only a replicated projections (v7, about v6 - I didn't checked)
For common usage:
General Parameters >> MaxAutoSegColumns
No, I mean if elastic cluster is disabled, so DBD will create only replicated projection, but its DBD only. This is a workaround to create MODULARHASH segmentation (don't do a deploy >> edit deploy script >> add disable in the beginning and enable in the end).
Manually everything works correct.
Thanks to Harshad Dhavale for info: