Skip to main content

LAP - anchor table

  • August 13, 2014
  • 5 replies
  • 14 views

Daniel_Leybovic
Forum|alt.badge.img+1
Hi!

What is exact definition of ANCHOR PROJECTION?  Its not clear from docs
Anchor Projection

An anchor projection is the physical storage for the anchor table data.

Before you create a live aggregate projection, you must create an anchor projection for the anchor table. The anchor projection's segmentation must be a subset of the live aggregate projection's segmentation. Each anchor table used for a live aggregate projection must have at least one anchor projection.

When you create a Top-K projection, the anchor table must have at least one projection that has the same PARTITION BY definition as in the CREATE PROJECTION statement. This projection is the anchor projection for the Top-K projection.

Sometimes I get after I created an anchor projection (I think that I created, but actually its not):
ROLLBACK 0:  Cannot create aggregate/top-k projection: no suitable anchor projection.
Group-by/Partition-by columns of aggregate/top-k projection must be in the same order as and include all the segmentation columns of the anchor projection.
Anchor projection must contain all columns of the aggregate/top-k projection.
Anchor projection must be segmented by hash in case of multinode database.
Anchor projection must be ksafe
So I can't understand what does it mean ANCHOR PROJECTION.

5 replies

Daniel_Leybovic
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • August 13, 2014
The anchor projection's segmentation must be a subset of the live aggregate projection's segmentation.
If segmentation of anchor projection is SUBSET of LAP, so anchor projection actually is  a "subset" of LAP.  :(

Navin_C
Forum|alt.badge.img+2
  • Participating Frequently
  • August 13, 2014
Hi Daniel,

I too got confused with this first, but then I figured it out.
Anchor Projection is nothing but the  a base projection for LAP with its rules on Segmentation columns and segmentation method.

This really leaves us with with 3 copies of same data.
A Super projection
A Anchor Projection
a Live Aggregate projection.

NC



Daniel_Leybovic
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • August 13, 2014
Hi!

Thanks for response.
What means "a base projection"? Same columns, same segmentation, same columns order but "pure" columns? Without any expression/group by, etc?

Thanks.

Daniel_Leybovic
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • August 13, 2014
Docs are unclear:
You cannot create a live aggregate projection that performs joins.
but syntax of LAP, says:
Syntax
CREATE PROJECTION [ IF NOT EXISTS ]   ...[[db-name.]schema.]projection-name   ...[ ( { projection-column ...| {   GROUPED ( column-reference1, column-reference2 [ ,... ])}  ......... [ ACCESSRANK integer ]   ......... [ ENCODING Encoding-Type ] } [ ,... ] )  ...]  AS SELECT {table-column | expr_with_columns } [ , ... ] FROM table-reference [ , ... ]  ... [ WHERE Join-Predicate [ AND join-predicate ] ...  ... [ GROUP BY expression ]  ... [ KSAFE [ k-num ] ]  

Daniel_Leybovic
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • August 13, 2014
Finally located a problem - segmentation by modularhash when elastic cluster is enabled.

Question can be closed.
Thanks Navin for help.