Advice on defining indexes

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Advice on defining indexes
Date: 2013-10-04 21:28:12
Message-ID: CAAY=A7-0zDKj6diOa7i-jX+biriJ9z-XFjjw-wM6jLzSKQ3Y9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have a table with fields that I guess would be a good idea to set as
indexes because users may query it to get results ordered by different
criteria. For example:

------------------
Artists Table
------------------
1. art_id
2. art_name
3. art_bday
4. art_sex
5. art_country (foreign key, there is a table of countries)
6. art_type (foreign key, there is a table of types of artists)
7. art_email
8. art_comment
9. art_ bio

"art_id" is the primary key.
Users query the table to get results ordered by fields (2) to (6). Is it
wise to define such fields as indexes?

I ask this question because our database has additional tables with the
same characteristics and maybe there would be many indexes.

With respect,
Jorge Maldonado

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Johnston 2013-10-04 22:09:03 Re: Advice on defining indexes
Previous Message Adrian Klaver 2013-10-04 19:49:18 Re: Unique index VS unique constraint