AWS aurora-dsql documentation change
Summary
Added sample table schemas and index details, updated statistics management guidance
Security assessment
Performance optimization documentation without security implications
Diff
diff --git a/aurora-dsql/latest/userguide/reading-dsql-explain-plans.md b/aurora-dsql/latest/userguide/reading-dsql-explain-plans.md index dc0abca2d..5ea4e2b2c 100644 --- a//aurora-dsql/latest/userguide/reading-dsql-explain-plans.md +++ b//aurora-dsql/latest/userguide/reading-dsql-explain-plans.md @@ -5 +5 @@ -Full Scan exampleIndex Only Scan exampleIndex Scan exampleBest Practices +Sample tablesFull Scan exampleIndex Only Scan exampleIndex Scan exampleBest Practices @@ -10,0 +11,24 @@ Understanding how to read EXPLAIN plans is key to optimizing query performance. +## Sample tables used in these examples + +The examples below reference two tables: `transaction` and `account`. + +The `transaction` table does not have a primary key, which causes Aurora DSQL to perform full table scans when querying it. + +The `account` table has an index on `customer_id`. This index includes `balance` and `status` as covering columns, which allows certain queries to be satisfied directly from the index without reading from the base table. However, the index does not include `created_at`, so queries that reference this column require additional table access. + + + CREATE TABLE transaction ( + account_id uuid, + transaction_date timestamp, + description text + ); + + CREATE TABLE account ( + customer_id uuid, + balance numeric, + status varchar, + created_at timestamp + ); + + CREATE INDEX ASYNC idx1 ON account (customer_id) INCLUDE (balance, status); + @@ -105 +129 @@ Adding frequently used columns as `INCLUDE` fields can often eliminate this look - * **Keep statistics up to date** to ensure cost and row estimates are accurate. + * **Validate row estimates** when investigating performance issues. Aurora DSQL manages statistics automatically by running `ANALYZE` in the background based on data change rates. If estimates appear inaccurate, you can run `ANALYZE` manually to refresh statistics immediately.