Working with data and history in Amazon QLDB
Important
End of support notice: Existing customers will be able to use Amazon QLDB until end of support on 07/31/2025. For more details, see
Migrate an Amazon QLDB Ledger to Amazon Aurora PostgreSQL
The following topics provide basic examples of create, read, update, and delete (CRUD) statements. You can manually run these statements by using the PartiQL editor on the QLDB console, or the QLDB shell. This guide also walks you through the process of how QLDB handles your data as you make changes in your ledger.
QLDB supports the PartiQL
For code examples that show how to programmatically run similar statements using the QLDB driver, see the tutorials in Getting started with the driver.
Tip
The following is a short summary of tips and best practices for working with PartiQL in QLDB:
-
Understand concurrency and transaction limits – All statements, including
SELECT
queries, are subject to optimistic concurrency control (OCC) conflicts and transaction limits, including a 30-second transaction timeout. -
Use indexes – Use high-cardinality indexes and run targeted queries to optimize your statements and avoid full table scans. To learn more, see Optimizing query performance.
-
Use equality predicates – Indexed lookups require an equality operator (
=
orIN
). Inequality operators (<
,>
,LIKE
,BETWEEN
) don't qualify for indexed lookups and result in full table scans. -
Use inner joins only – QLDB supports inner joins only. As a best practice, join on fields that are indexed for each table that you're joining. Choose high-cardinality indexes for both the join criteria and the equality predicates.
Topics
- Creating tables with indexes and inserting documents
- Querying your data
- Querying document metadata
- Using the BY clause to query document ID
- Updating and deleting documents
- Querying revision history
- Redacting document revisions
- Optimizing query performance
- Getting PartiQL statement statistics
- Querying the system catalog
- Managing tables
- Managing indexes
- Unique IDs in Amazon QLDB