Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tanga_social_development=# explain analyze select * from preferences where paranoid_about_privacy = false limit 1;
- QUERY PLAN
- ------------------------------------------------------------------------------------------------------------------
- Limit (cost=0.00..0.02 rows=1 width=26) (actual time=0.015..0.016 rows=1 loops=1)
- -> Seq Scan on preferences (cost=0.00..450.35 rows=27652 width=26) (actual time=0.013..0.013 rows=1 loops=1)
- Filter: (NOT paranoid_about_privacy)
- Total runtime: 0.040 ms
- (4 rows)
- tanga_social_development=# explain analyze select * from preferences where paranoid_about_privacy = true limit 1;
- QUERY PLAN
- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Limit (cost=0.00..0.11 rows=1 width=26) (actual time=22.101..22.102 rows=1 loops=1)
- -> Index Scan using index_preferences_on_paranoid_about_privacy on preferences (cost=0.00..41.86 rows=383 width=26) (actual time=22.099..22.099 rows=1 loops=1)
- Index Cond: (paranoid_about_privacy = true)
- Filter: paranoid_about_privacy
- Total runtime: 22.181 ms
- (5 rows)
- tanga_social_development=# \d preferences
- Table "public.preferences"
- Column | Type | Modifiers
- ------------------------+-----------------------------+----------------------------------------------------------
- id | integer | not null default nextval('preferences_id_seq'::regclass)
- user_id | integer | not null
- paranoid_about_privacy | boolean | default false
- created_at | timestamp without time zone |
- updated_at | timestamp without time zone |
- receive_email | boolean | default true
- Indexes:
- "preferences_pkey" PRIMARY KEY, btree (id)
- "index_preferences_on_paranoid_about_privacy" btree (paranoid_about_privacy)
- "index_preferences_on_user_id" btree (user_id)
- "test_index" btree (user_id, paranoid_about_privacy)
Add Comment
Please, Sign In to add comment