TITLE: When is $L^2(X)$ separable? 
QUESTION [44 upvotes]: I have never studied any measure theory, so apologise in advance, if my question is easy:
Let $X$ be a measure space. How can I decide whether $L^2(X)$ is separable?
In reality, I am interested in Borel sets on a locally compact space $X$. I can also assume that the support of the measure is $X$, if it helps...
I cannot even decide at the moment for which locally compact groups $G$ with Haar measure, $L^2(G)$ is separable...

REPLY [10 votes]: I have just found an old article which contains the following result: for a locally compact group $G$, its topological weight $w(G)$ [the minimal cardinality of a topology base] is equal to the dimension of $L^2(G)$. Whence $L^2(G)$ is separable iff $G$ is second countable. This is Theorem 2 in: de Vries, J. The local weight of an effective locally compact transformation group and the dimension of $L^2(G)$. Colloq. Math. 39 (1978), no.2, 319-323.
Since I spent a considerable time searching for such a reference, I post it here.
Worth noting also that the case of a compact $G$ is contained in Hewitt-Ross, Theorem 28.2.