Skip to content

Instantly share code, notes, and snippets.

@fabiokr
Created May 11, 2012 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiokr/2660707 to your computer and use it in GitHub Desktop.
Save fabiokr/2660707 to your computer and use it in GitHub Desktop.
1.9.3p194 :105 > Customer.count
(4.5ms) SELECT COUNT(*) FROM "customers"
=> 10025
1.9.3p194 :106 > Contact.count
(8.2ms) SELECT COUNT(*) FROM "contacts"
=> 20050
1.9.3p194 :107 > Address.count
(9.3ms) SELECT COUNT(*) FROM "addresses"
=> 30125
1.9.3p194 :108 > Hardware.count
(9.8ms) SELECT COUNT(*) FROM "hardwares"
=> 30380
1.9.3p194 :109 > Search.for_term("rod")
Search Load (1130.7ms) SELECT "searches".*, (ts_rank((to_tsvector('simple', unaccent(coalesce("searches"."term", '')))), (to_tsquery('simple', ''' ' || unaccent('rod') || ' ''')), 0)) AS pg_search_rank FROM "searches" WHERE (((unaccent(coalesce("searches"."term", ''))) % unaccent('rod'))) ORDER BY pg_search_rank DESC, "searches"."searchable_id" ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment