Created
January 21, 2012 00:20
-
-
Save bkempner/1650406 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
de2nq092qkqfxll=> create index ben_test_partial on units (city_name) where is_deleted = true; | |
CREATE INDEX | |
de2nq092qkqfxll=> explain select count(*) from units where city_name = 'San Francisco' and is_deleted = true; | |
QUERY PLAN | |
---------------------------------------------------------------------------------------- | |
Aggregate (cost=1276.17..1276.17 rows=1 width=0) | |
-> Bitmap Heap Scan on units (cost=35.38..1276.00 rows=331 width=0) | |
Recheck Cond: (((city_name)::text = 'San Francisco'::text) AND is_deleted) | |
-> Bitmap Index Scan on ben_test_partial (cost=0.00..35.37 rows=331 width=0) | |
Index Cond: ((city_name)::text = 'San Francisco'::text) | |
(5 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment