I need to perform range query efficiently. I have the table like:

user_id | age | gender | salary | ...

The attr user_id is the PRIMARY KEY.

Example of querying:

select * from users where user_id = 'x' and age > y and age < z and salary > a and salary < and age='M';

This query takes a long time to run. Any ideas to perform it efficiently?

Tks in advance.

Sávio S. Teles de Oliveira
voice: +55 62 9136 6996
Mestrando em Ciências da Computação - UFG
Arquiteto de Software
Laboratory for Ubiquitous and Pervasive Applications (LUPA) - UFG