Follow

K-BP03: Using Store-only feature to save memory in Kinetica

This document provides instructions on using "store-only" to reduce memory utilization

Affects versions: 6.1, 6.2

OVERVIEW

The store only feature in Kinetica controls whether a column is loaded into memory or stored in disk. It is mainly controlled in the table creation process, but it can be toggled by an alter table command. 

Store only columns are special in the way that not all types of queries can be run against a column with this feature, and when queried a slight performance impact might be noticed.

Store only columns are limited to data extraction operations as this columns reside only in disk. 

Operations that are not applicable to store only columns are:

  • Scalar or aggregates column functions
  • Subqueries requiring a temporary view to be created
  • Where clauses
  • Group By
  • Join operations
  • Union operations
  • Intersect operations
  • Except
  • Create Table ... As

Note: Toggling store only property on a table is a very expensive request and will take a long time to complete depending on the amount of data in the table

ACTION

Dictionary encoding can be achieved at ingestion time:

CSV Headers: To set store_only property on the CSV headers prior to a data import, the "dict" property has to be set. I.e:

int_col|int|store_only

 

SQL: Store)only property can be set via SQL either at table creation or by issuing an alter table command. I.e:

Create table:

CREATE REPLICATED TABLE test_store
(
int_col int(store_only), -- int using store_only to store values only in disk
)

Alter table:

ALTER TABLE test_store
ALTER COLUMN int_col int(STORE_ONLY)

 

API's: Store_only property can be set using the native API's.

I.e using Rest API:

curl -X POST http://localhost:9191/alter/table --header "Content-Type: application/json" -d '{"table_name":"test_store","action":"change_column","value":"int_col","options":{"column_properties":"store_only"}}'

 


Should you have any questions or concerns, please visit our support page, official documentation

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.