Skip to contents

Looks up table_name in the per-dataset index registry (see .morie_db_index_registry() for the full list) and creates each CREATE INDEX IF NOT EXISTS against con. Specs whose columns aren't present in the actual table are silently skipped, so this is safe to call on any morie cache table — including subsets that drop some columns. Returns the number of CREATE INDEX statements that actually ran (not the number registered).

Usage

morie_db_create_indexes(con, table_name)

Arguments

con

A DBI connection.

table_name

The cache table name (case-sensitive). Common short names: "SIU", "b01", "c01", "d01", "uof_main_records", "assault", "homicide", etc.

Value

Invisibly returns the integer count of CREATE INDEX statements executed.

Details

Cardinality-based selection: every indexed column has > 30 distinct values in the real published data; low-cardinality columns (Gender, Yes/No alerts, Measure) are intentionally skipped because the index overhead exceeds the lookup benefit.