Skip to content

Instantly share code, notes, and snippets.

@stephencweiss
Last active November 21, 2018 16:16
Show Gist options
  • Save stephencweiss/58fa8732d630f0eda7eed7edba19c6a7 to your computer and use it in GitHub Desktop.
Save stephencweiss/58fa8732d630f0eda7eed7edba19c6a7 to your computer and use it in GitHub Desktop.
Sample Queries on a Postgres Database with 10m primary records
SELECT (product_id, product_name, created_at) FROM descriptions WHERE product_id = 19282;
SELECT COUNT(product_id) FROM descriptions;
SELECT (product_id, product_name, created_at) FROM descriptions ORDER BY created_at DESC LIMIT 10;
@stephencweiss
Copy link
Author

image
image
image
The performance of the last 10 created query indicates a potential gain from indexing on created_at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment