In another question they told me that the speed of a DBMS largely depends on the optimizations of your queries. Does anybody know good documents about this? At school I only learned the basics.

For example, a query to find a user with a password.

I would take this from a table that holds the personal information or just only username/password.

My query would look something like:

    SELECT username, password
    FROM tblUsers
    WHERE username = foo

Is there any optimization to this? Or is it only in very large operations, like having a lot of JOINS with a large number of records?