forked from benhamill/railsconf_2011
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknowsql.txt
41 lines (26 loc) · 957 Bytes
/
knowsql.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
KnowSQL
Nick Gauthier
slides: http://knowsql.heroku.com
INDICES
validates_uniqueness_of does a SELECT before INSERT, which is slow.
Model.save(:validations => false) if that fails, Model.save to get nice
messages from Rails.
DB VALIDATIONS
fast
gem: matthuhiggings-foreigner https://github.com/matthuhiggins/foreigner
GEOSPATIAL DATA
PostGIS module for indexing Geo data.
Look up slides for more depth. AWESOME for HeyGoVote.
SRID for jus the US?
Lines and polygons (outline a county and give me points in there? Jesus.)
FULL TEXT SEARCH
ts_headline('english', title, to_tsquery('english', 'puppy')) as headline.
SubjectLin.es
JOIN, AGGREGATE, VIEW
SearchCaches are OUT: Make DB view, instead. Holy shit.
SHOULDERS OF GIANTS
Postgres plugins:
- chkpass # password datatype with nice searching.
- hstore # store & query hashes.
- ltree # tree structure datatype.
- isn # ISBN, ISMN, etc. Will run check bits.