I am in a holding pattern while client decides upon changes and so I am
working some things out internally so it seems to me that indexing
frequently searched table fields might be useful.
I am using postgres and via postgres, I have added an index to one of my
tables whose index is the same name as the column name. The ‘find’
screen I am using this to judge populates a number of ‘selection lists’
from a ‘valuelists’ table so it hits this table with 4 separate queries
to populate 4 separate selection lists. I can’t see any difference in
speed. Do I have to reference the index within my controller code?
@employment_type = Valuelist.find(:all, :conditions => ["list_name = 'Employment Type'"], :order => 'list_value') @position = Valuelist.find(:all, :conditions => ["list_name = 'Position'"], :order => 'list_value')
‘list_name’ is now indexed but it still takes the same amount of time to
display this page which I am sure is the result of 4 separate ‘finds’ in
“valuelists” table (2 are shown above). Am I supposed to reference the
index in controller code above?