CREATE INDEX idx_username_hash ON tablename USING hash (username);This creates a hash index on the 'username' column.
WHERE column = value, PostgreSQL can use the hash index to quickly find the matching rows by hashing the value and looking up the location directly.