Guest User

Untitled

a guest
May 16th, 2018
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. tanga_social_development=# explain analyze select * from preferences where paranoid_about_privacy = false limit 1;
  2. QUERY PLAN
  3. ------------------------------------------------------------------------------------------------------------------
  4. Limit (cost=0.00..0.02 rows=1 width=26) (actual time=0.015..0.016 rows=1 loops=1)
  5. -> Seq Scan on preferences (cost=0.00..450.35 rows=27652 width=26) (actual time=0.013..0.013 rows=1 loops=1)
  6. Filter: (NOT paranoid_about_privacy)
  7. Total runtime: 0.040 ms
  8. (4 rows)
  9.  
  10. tanga_social_development=# explain analyze select * from preferences where paranoid_about_privacy = true limit 1;
  11. QUERY PLAN
  12. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  13. Limit (cost=0.00..0.11 rows=1 width=26) (actual time=22.101..22.102 rows=1 loops=1)
  14. -> 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)
  15. Index Cond: (paranoid_about_privacy = true)
  16. Filter: paranoid_about_privacy
  17. Total runtime: 22.181 ms
  18. (5 rows)
  19.  
  20. tanga_social_development=# \d preferences
  21. Table "public.preferences"
  22. Column | Type | Modifiers
  23. ------------------------+-----------------------------+----------------------------------------------------------
  24. id | integer | not null default nextval('preferences_id_seq'::regclass)
  25. user_id | integer | not null
  26. paranoid_about_privacy | boolean | default false
  27. created_at | timestamp without time zone |
  28. updated_at | timestamp without time zone |
  29. receive_email | boolean | default true
  30. Indexes:
  31. "preferences_pkey" PRIMARY KEY, btree (id)
  32. "index_preferences_on_paranoid_about_privacy" btree (paranoid_about_privacy)
  33. "index_preferences_on_user_id" btree (user_id)
  34. "test_index" btree (user_id, paranoid_about_privacy)
Add Comment
Please, Sign In to add comment