Skip to content

Instantly share code, notes, and snippets.

@aymanosman
Last active August 29, 2015 14:18
Show Gist options
  • Save aymanosman/be895a7d05bb6c14bcbe to your computer and use it in GitHub Desktop.
Save aymanosman/be895a7d05bb6c14bcbe to your computer and use it in GitHub Desktop.
Explain select on uuid::varchar
EXPLAIN select * from tablename where uuid LIKE 'as%';
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------
Index Scan using tablename_uuid_like on tablename (cost=0.14..8.16 rows=1 width=1476)
Index Cond: (((uuid)::text ~>=~ 'as'::text) AND ((uuid)::text ~<~ 'at'::text))
Filter: ((uuid)::text ~~ 'as%'::text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment