Reputation: 1
My problem is when I run this statement:
select * from ADMIN.TABLE WHERE NOM="" AND PRENOM =""
It takes more than 5 minutes because NOM
and PRENOM
are not primary keys. How can I improve the performance?
Upvotes: 0
Views: 46
Reputation: 1269513
You can speed up this query using an index:
select *
from admin.table
where nom = '' and prenom = '';
The appropriate index is admin.table(nom, prenom)
:
create index idx_table_nom_prenom on admin.table(nom, prenom);
Upvotes: 1