-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When querying on a table with a small number of records (like in development), the Postgres query-planner may ignore indexes in favor of sequential scans.
It would be beneficial to have an option to force Postgres to use indexes when performing the query to better simulate production behavior.
An example implementation is:
Wallet.where(base_currency: "USD").explain(analyze: true, indexscan: true)would be equivalent to:
ActiveRecord::Base.connection.execute('SET enable_seqscan = OFF')
Wallet.where(base_currency: "USD").explain(analyze: true)
ActiveRecord::Base.connection.execute('SET enable_seqscan = ON')Metadata
Metadata
Assignees
Labels
No labels