sql - indexing multi-column index with Rails / Postgresql -
i have doubt correct indexing. use rails 3.2.13, using posgresql behind. btw, more relational databases/indexing question... i have table: # table name: exams # # id :integer not null, primary key # cognomenome :string(255) # matricola :string(255) # corsolaurea :string(255) # annoaccademico :string(255) # blablabla # # indexes # # index_exams_on_annoaccademico (annoaccademico) # index_exams_on_cognomenome (cognomenome) # index_exams_on_corsolaurea (corsolaurea) # index_exams_on_matricola (matricola) i'd query thousands record table (the nymber of records increase every year linearly, 500 items evey years, i.e. 5000-6000 in ten years); i have make these kind of queries: select "exams".* "exams" (upper(cognomenome) '%giorgio%') order annoaccademico desc, corsolaurea, cognomenome limit 50 offset 0 or that: select "exams".* "exams" (matricola '%8327483274%...