# Indexes

## Local Seconday Index (_LSI_)

* This provides an `Alternative Sort Key` for your table, but with same partition key of the base table.
* This sort key can be a scalar attribute of type `String`, `Binary` or `Number` of base table.
* Can have upto 5 LSI per table.
* Must be defined at table creation time.
* It may contain some or all attribute from base table.
* `LSI` uses capacity units of base table.

## Global Seconday Index (_GSI_)

* Alternative Primary key from the base table.
* This index enables to speed up the queries based on non-key attributes.
* Index key consists of scalar attributes from base table of type `Number`, `String` or `Binary`.
* Attribute projections can be some or all attributes of the base table.
* Must provision `RCU` and `WCU` for the index _(kind of like a new table)_.
* They can be created/modified after table creation.

## Throttling

### GSI Index

* If writes are throttled on GSI, then the main table will be throttled even if there is enough capacity on main table.

### LSI Index

* No need for special consideration of throttling.
* They use `WCU` and `RCU` of main table.
