all-things-risingwave
Why doesn't rw_indexes list primary keys in RisingWave?
Rick Otten noticed that rw_indexes didn't list any of the primary keys while doing query analysis. Chenggang Wu provided an explanation for this behavior in RisingWave related to primary keys and indexes.
Ri
Rick Otten
Asked on Apr 11, 2024
- In RisingWave, when you define a primary key for a table, it implicitly creates an index for that primary key.
- The index for the primary key may not be visible in
rw_indexes
or similar metadata tables. - This behavior aligns with PostgreSQL compatibility, where primary keys automatically create unique indexes under the hood to enforce uniqueness constraints but are managed internally.
- There is no need to explicitly create an index for a primary key in RisingWave.
Apr 11, 2024Edited by