My surprise reached a climax, however, when I found incidentally that he was ignorant of the Copernican Theory and of the composition of the Solar System. That any civilized human being in this nineteenth century should not be aware that the earth travelled round the sun appeared to be to me such an extraordinary fact that I could hardly realize it. […] “But the Solar System!” I protested.
“What the deuce is it to me?” he interrupted impatiently; “you say that we go round the sun. If we went round the moon it would not make a pennyworth of difference to me or to my work.”

Arthur Conan Doyle (1859-1930) British writer and physician
Story (1886-04), “A Study in Scarlet,” Part 1, ch. 2, Beeton’s Christmas Annual, Vol. 28 (1887-11-21)
    (Source)

Watson speaking of and with Holmes. This passage is followed by this one.

Published in novel form 1888-07.

In the Sherlock TV episode 01x03 "The Great Game" (w. Mark Gatiss) (2010-08-08), this explanation is reworked (including this analogous passage):

HOLMES: Look, it doesn't matter to me who's Prime Minister, or who's sleeping with whom --
WATSON: Or that the earth goes around the sun.
HOLMES: Oh God, that again! It's not important!
WATSON: Not important? It's primary school stuff! How can you not know that?
HOLMES: Well, if I ever did, I've deleted it.
WATSON: "Deleted it"?
HOLMES: Listen: (points to his head) This is my hard-drive, and it only makes sense to put things in there that are useful. Really useful. Ordinary people fill their heads with all kinds of rubbish, and that makes it hard to get at the stuff that matters! Do you see?
WATSON: (brief silence) But it's the solar system!
HOLMES: Oh, hell! What does that matter?! So we go around the sun! If we went around the moon or round and round the garden like a teddy bear, it wouldn't make any difference! All that matters to me is the work!