hypopg

Create and test hypothetical PostgreSQL indexes without overhead

brewmacoslinux
Try with needOr install directly
Source

About

Hypothetical Indexes for PostgreSQL

Examples

check if an index would improve query performance$ CREATE INDEX CONCURRENTLY hypo_idx ON table_name (column_name); EXPLAIN SELECT * FROM table_name WHERE column_name = 'value';
test multiple index designs to find the best one$ SELECT hypopg_create_index('CREATE INDEX ON users (email, created_at)'); EXPLAIN SELECT * FROM users WHERE email = 'test@example.com';
see estimated query plan improvement without creating real indexes$ SELECT * FROM hypopg_create_index('CREATE INDEX ON orders (customer_id, status)'); EXPLAIN SELECT * FROM orders WHERE customer_id = 123 AND status = 'pending';
list all hypothetical indexes currently in the session$ SELECT * FROM hypopg_list_indexes();
remove a hypothetical index after testing$ SELECT hypopg_drop_index(index_oid);