Rebuilding partitioned projections with pre-aggregated data

If you created projections in earlier (pre-10.0.x) releases with pre-aggregated data (for example, LAPs and TopK projections) and the anchor tables were partitioned with a GROUP BY clause, their ROS containers are liable to be corrupted from various DML and ILM operations.

If you created projections in earlier (pre-10.0.x) releases with pre-aggregated data (for example, LAPs and TopK projections) and the anchor tables were partitioned with a GROUP BY clause, their ROS containers are liable to be corrupted from various DML and ILM operations. In this case, you must rebuild the projections:

  1. Run the meta-function REFRESH on the database. If REFRESH detects problematic projections, it returns with failure messages. For example:

    => SELECT REFRESH();
                                                   REFRESH
    -----------------------------------------------------------------------------------------------------
    Refresh completed with the following outcomes:
    Projection Name: [Anchor Table] [Status] [ Refresh Method] [Error Count]
    "public"."store_sales_udt_sum": [store_sales] [failed: Drop and recreate projection] [] [1]
    "public"."product_sales_largest": [store_sales] [failed: Drop and recreate projection] [] [1]
    "public"."store_sales_recent": [store_sales] [failed: Drop and recreate projection] [] [1]
    
    (1 row)
    

    Vertica also logs messages to vertica.log:

    2020-07-07 11:28:41.618 Init Session:ox7fabbbfff700-aoo000000oosbs [Txnl <INFO> Be in Txn: aoooooooooo5b5 'Refresh: Evaluating which projection to refresh'
    2020-07-07 11:28:41.640 Init Session:ex7fabbbfff7oe-aooooeeeeoosbs [Refresh] <INFO> Storage issues detected, unable to refresh projection 'store_sales_recent'. Drop and recreate this projection, then refresh.
    2020-07-07 11:28:41.641 Init Session:Ox7fabbbfff700-aooooeooooosbs [Refresh] <INFO> Storage issues detected, unable to refresh projection 'product_sales_largest'. Drop and recreate this projection, then refresh.
    2020-07-07 11:28:41.641 Init Session:Ox7fabbbfff700-aeoeeeaeeeosbs [Refresh] <INFO> Storage issues detected, unable to refresh projection 'store_sales_udt_sum'. Drop and recreate this projection, then refresh.
    
  2. Export the DDL of these projections with EXPORT_OBJECTS or EXPORT_TABLES.

  3. Drop the projections, then recreate them as defined in the exported DDL.

  4. Run REFRESH. Vertica rebuilds the projections with new storage containers.