Advanced
Index Management
Create, inspect and drop indexes from the sidebar.
From the Sidebar
Right-click a collection or table to manage its indexes — supported for MongoDB, PostgreSQL, SQL Server and Aerospike:
- Create index: name, key definition, and (where the engine supports it) unique and background options
- Drop index: with confirmation
How to: create an index from the sidebar
- Right-click the collection or table and choose Create index
- Name the index and define the key — the fields to index and their order
- Pick options where offered (unique, background) and confirm
- Verify with the stats tooltip (index count/size) or an
explainquery — see below
The stats tooltip on each collection/table shows index count and total index size at a glance.
ClickHouse works differently by design — its ordering key and skip indexes are part of the
table definition (ORDER BY in the engine clause), which you manage in DDL
through the query editor.
From the Shell
Everything index-related also works as a plain query, with autocomplete:
// MongoDB
db.getCollection("orders").createIndex({ customerEmail: 1, orderedAt: -1 })
db.getCollection("orders").getIndexes() -- PostgreSQL
CREATE INDEX idx_orders_status ON orders (status);
SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'orders'; Checking Whether an Index Is Used
// MongoDB: look for IXSCAN vs COLLSCAN
db.getCollection("orders").find({ status: "pending" }).explain("executionStats") -- PostgreSQL
EXPLAIN ANALYZE SELECT * FROM orders WHERE status = 'pending'; Rules of Thumb
- Index the fields you filter and sort on — in that order for compound indexes
- Every index costs write performance and storage; drop the ones nothing uses
- Measure before and after with
explain— assumptions about the planner are usually wrong