PostgreSQL as a secret weapon for high-performance ... - PGCon
PostgreSQL as a secret weapon for high-performance ... - PGCon
PostgreSQL as a secret weapon for high-performance ... - PGCon
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Rails <strong>as</strong> ORM > Attribute Preloading<br />
The conventional Rails way is not so bad:<br />
T<strong>as</strong>ks Tags T<strong>as</strong>ks_Tags<br />
id serial id serial tag_id integer<br />
name varchar name varchar t<strong>as</strong>k_id integer<br />
t<strong>as</strong>ks = T<strong>as</strong>k.find(:all, :include => :tags)<br />
select * from t<strong>as</strong>ks<br />
select * from tags inner join t<strong>as</strong>ks_tags<br />
on tags.id = t<strong>as</strong>ks_tags.tag_id<br />
where t<strong>as</strong>ks_tags.t<strong>as</strong>k_id in (1,2,3,..)<br />
Gleb Arshinov & Alex Dymo ● <strong>PostgreSQL</strong> <strong>as</strong> a <strong>secret</strong> <strong>weapon</strong> <strong>for</strong> <strong>high</strong>-per<strong>for</strong>mance Ruby on Rails applications ● <strong>PGCon</strong> 2010 8 / 58