Writing and deploying custom projections
Before you write custom projections, review the topics in Planning your design carefully. Failure to follow these considerations can result in non-functional projections.
To manually modify or create a projection:
-
Write a script with
CREATE PROJECTION
statements to create the desired projections. -
Run the script in vsql with the meta-command
\i
.Note
You must have a database loaded with a logical schema. -
For a K-safe database, call Vertica meta-function
GET_PROJECTIONS
on tables of the new projections. Check the output to verify that all projections have enough buddies to be identified as safe. -
If you create projections for tables that already contains data, call
REFRESH
orSTART_REFRESH
to update new projections. Otherwise, these projections are not available for query processing. -
Call
MAKE_AHM_NOW
to set the Ancient History Mark (AHM) to the most recent epoch. -
Call
DROP PROJECTION
on projections that are no longer needed, and would otherwise waste disk space and reduce load speed. -
Call
ANALYZE_STATISTICS
on all database projections:=> SELECT ANALYZE_STATISTICS ('');
This function collects and aggregates data samples and storage information from all nodes on which a projection is stored, and then writes statistics into the catalog.