Joined September 2012
·

Jake Moffatt

Programmer at Apartment List
·
California
·
·
·

Posted to Postgres, Rails, and Regex's over 1 year ago

you can also use a partial index in postres to optimize this query:

create index concurrently integer_responses on responses ((value ~ '^\d+$'));

and don't forget the opposite case as well:

create index concurrently string_responses on responses ((value !~ '^\d+$'));

Then when you execute the query/scope you will still benefit from an index.

Posted to One line browser notepad over 1 year ago

I made a version that is a full blown Ruby editor with syntax highlighting from Ace.

https://gist.github.com/4666256

Achievements
164 Karma
2,443 Total ProTip Views