Paul McKay wrote:
> Hi,
>
>
>
> I am executing a query on a table:
>
>
>
> Table "public.measurement"
>
> Column | Type | Modifiers
>
> ------------+-----------------------+-----------
>
> assessment | integer |
>
> time | integer |
>
> value | character varying(50) |
>
> Indexes: idx_measurement_assessment btree (assessment),
>
> idx_measurement_time btree ("time")
>
>
>
> The primary key of the table is a combination of assessment and time,
> and there are indexes on both assessment and time.
>
>
>
> The query I am executing is
>
>
>
> Select time,value
>
> From measurement
>
> Where assessment = ?
>
> And time between ? and ?
Changing 2 indexes into one both-fields index should improve
performance much.
create index ind_meas on measurement (assessment,time).
Regards,
Tomasz Myrta