$40k isn't much anywhere in the US, not just in San Fransisco. Mississippi is the poorest state in the US, with a median household income at $37,095.
Cite: http://www.parade.com/166996/viannguyen/what-are-the-10-rich...
Cite: http://www.parade.com/166996/viannguyen/what-are-the-10-rich...
X% over in a wealthy city is going to give you the most extra money, good for buying BMW's, travel, and things on the internet.
$Y over in a poor city will make you locally wealthy, so you can eat at the nicest restaurants, afford the nicest houses, and maybe have hired help.