postgresql - Optimize a single record select query in SQL -
i have simple sql query want optimize:
select * users email = 'jon@gmail.com'
i want 1 record matches user's email.
is there can make query faster, aside adding index on email column?
does adding "limit 1" make faster?
what doing order email desc
since "j" in alphabet?
create index on column email
. there no other way make fast.
the exact syntax depends on database engine. if email unique (which common users table), make index unique too.
Comments
Post a Comment