From 3df100181188ab467630d811582b56246b1a576a Mon Sep 17 00:00:00 2001 From: Lee Lawlor Date: Sat, 17 May 2014 17:39:07 -0400 Subject: [PATCH] force use of proper index when getting feeds --- app/models/feed_factory.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/feed_factory.rb b/app/models/feed_factory.rb index e9bb221..319bfab 100644 --- a/app/models/feed_factory.rb +++ b/app/models/feed_factory.rb @@ -89,7 +89,8 @@ class FeedFactory < ApplicationController # get feeds def get_feeds # get feed based on conditions - @feeds = Feed.where(:channel_id => @channel.id, :created_at => @date_range) + @feeds = Feed.from("feeds FORCE INDEX (index_feeds_on_channel_id_and_created_at)") + .where(:channel_id => @channel.id, :created_at => @date_range) .select(@feed_select_options) .order('created_at desc') .limit(@limit)