Skip to content

Instantly share code, notes, and snippets.

@posix4e
Created November 19, 2015 22:18
Show Gist options
  • Save posix4e/98c88b171fc14341fc77 to your computer and use it in GitHub Desktop.
Save posix4e/98c88b171fc14341fc77 to your computer and use it in GitHub Desktop.
storage_prod=# explain SELECT name,cpu_hostname,extended,updated,created,concat(ST_Y(ST_Centroid(geom)),',',ST_X(ST_Centroid(geom))) as location FROM scenes WHERE bucket_id=30 AND EXTRACT(EPOCH FROM created) > EXTRACT(EPOCH FROM '2015-11-19'::timestamp) ORDER BY created limit 10;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------
Limit (cost=0.57..81.44 rows=10 width=819)
-> Index Scan using scene_bucket_id_created_idx on scenes (cost=0.57..26376379.94 rows=3261661 width=819)
Index Cond: (bucket_id = 30)
Filter: (date_part('epoch'::text, created) > 1447891200::double precision)
(4 rows)
ndexes:
"scenes_pkey" PRIMARY KEY, btree (id)
"unique_bucket_name_idx" UNIQUE, btree (bucket_id, name)
"idx_scenes_geom_new" gist (geom)
"scene_bucket_id_created_idx" btree (bucket_id, created)
"scene_bucket_id_idx" btree (bucket_id)
"scene_bucket_id_idx_live" btree (bucket_id, id)
"scene_bucket_id_name_pattern_idx" btree (bucket_id, name varchar_pattern_ops)
"scene_bucket_id_pass_at_idx" btree (bucket_id, pass_at)
"scene_created_idx_new" btree (created)
"scene_name_idx_new" btree (name)
"scene_name_pattern_idx_new" btree (name varchar_pattern_ops)
"scene_pass_at_idx" btree (pass_at)
"scene_strip_id_idx" btree (strip_id) INVALID
"scene_strip_id_idx_new" btree (updated)
"scene_strip_id_idx_newer" btree (strip_id)
"scene_updated_idx_new" btree (updated)
"scenes_bucket_id_updated_idx" btree (bucket_id, updated)
"scenes_checksum_idx" btree (checksum)
"scenes_geom_bucket_id_idx" gist (geom, bucket_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment