How do I find which file contains a function?
You can find it at includes/database/database.inc, line 2342.

Your editor may be providing a similar feature like the one implemented in Zend studio: When you press control while you click on the function name, it will take you to the file containing the implementation of that function.