Hacker News new | ask | show | jobs
by wacheena 5591 days ago
Great work. Can you expand on the FB oauth_id comment, how are you storing the ids now?
2 comments

This advice was thanks to the fabulous support at Rackspace (specifically Paul, ask for him). We had been fiddling with changing big queries to little queries, processing upfront vs behind the scenes, and nothing worked!

All we did was add a couple intval() calls into our php script and changed the column to big int AND add an index and we had one 30s query go down to 0.6s.

So:

Use ints whenever possible. Index.

/me shakes head in disbelief

"Index" is by far the big lesson here.

Also, 0.6s is still way too high. What kind of funky join are you doing?

We actually have no joins haha. The support always asked if he had joins but no...I actually don't even know how to do joins. But I hear that Facebook highly encourages not doing joins anyways...so efficient learning?
WTF mate? 0.6s is WAY too high if you're not doing a join. Catch me on IRC if you'd like a hand.
Now we store them as big ints. It has really helped us. What other details would be helpful to you? My email is dan at danshipper.com if you have more questions