Dmytro Shteflyuk’s Home Dmytro Shteflyuk’s Home

thoughts about programming

  • Blog
  • Resume
  • Projects
  • Tag Cloud
  • Library
  • Contact
  • РусскийРусский
  • EnglishEnglish

Using sub-queries to avoid multiple DB requests in Rails

2007 08:12 (Ruby & Rails) · Русский (11,819 views)

Apr 12

When I worked on Best Tech Videos with Alexey Kovyrin, we faced a problem of filtering videos by category with selecting posts categories in the same query. It was easy to solve the problem, but there is one query optimization trick exists.

Read the rest of entry »

Tagged active-record, filtering, optimization, Ruby & Rails, sql, sub-query

8 Comments

Categories

  • ASP.NET (9)
  • Debian (1)
  • Development (6)
  • Facebook (3)
  • JavaScript (10)
  • Links (13)
  • Mac OS X (3)
  • MySQL (4)
  • PHP (13)
  • Presentations (1)
  • Resume (5)
  • Ruby & Rails (29)
  • WordPress (4)

Archives

  • December 2009 (1)
  • November 2009 (1)
  • September 2009 (5)
  • August 2009 (1)
  • July 2009 (3)
  • May 2009 (3)
  • April 2009 (2)
  • January 2009 (1)
  • December 2008 (2)
  • January 2008 (3)
  • More…

Friends

  • Alexey Kovyrin
  • Best Tech Videos
  • Canada Blog
  • e0ne’s comments
  • Erka blog
  • Homo-Adminus Blog
  • IRIS Design

Meta

  • Log in

Syndication

Entries RSS (Eng)
Entries RSS (Rus)
Comments RSS

Latest Articles

Submitting a patch to the Open Source project: composite_primary_keys
December 17, 2009 12:28No Comments
My top 7 RSpec best practices
November 25, 2009 18:2220 Comments
Weekly Link Dump #2
September 22, 2009 15:512 Comments
Weekly Link Dump #1
September 14, 2009 11:481 Comment
In reply to latest articles in Thoughtbot blog
September 10, 2009 12:33No Comments

Currently reading:

  • High Performance MySQL: Optimization, Backups, Replication, and More
  • The Art of Agile Development

View full Library

 

Copyright © 2005 — 2009, Dmytro Shteflyuk