At the top of the source file
wp-includes/wp-db.php I can find the following comment:
/** * WordPress Database Access Abstraction Object * * It is possible to replace this class with your own * by setting the $wpdb global variable in wp-content/db.php * file to your class. The wpdb class will still be included, * so you can extend it or simply use your own.
I was wondering how replacing the wpdb class with a different class would work but I cannot find any file under wp-content/db.php. Is there an error in the documentation?