When it comes to the entertainment industry, it’s not much of a question. When it comes to tech, it’s not much of a question, either. But with regard to the frequency with which the terms are used, which of California’s great metros outshines the other: Los Angeles, or San Francisco?

As readers of this column know, we try to answer these questions in a few ways, and one of the best is utilizing the Google Books Ngram viewer, which compares how often different words and phrases have been used in published works.

The above graph charts results for more than 200 years, and, not surprisingly, in many ways showcases the history of the country’s most populous state. From the perspective of the United States — and the printed materials included in Ngram viewer’s analysis — Los Angeles and San Francisco were basically put on the map at the midpoint of the 19th century. The U.S. gained control of the region during and after the Mexican-American War in the 1840s; the Gold Rush followed soon after, and California was admitted as a state in 1850.

As the above graph shows, Los Angeles was no match for San Francisco in the early days of the state. The former was essentially a small town; the latter — which had a head start as an important base during the Gold Rush — was a growing metropolis with the most valuable port on the West Coast. In 1860, L.A. had some 4,000 residents; San Francisco had over 50,000 and was within 10 years of catapulting into the country’s 10 most populous cities.

As the decades passed, however, Los Angeles grew, buoyed in part by the arrival of railroads and the discovery of oil. In 1900, it had 100,000 residents — a fraction of what burgeoning San Francisco had by this point, but a legitimate city in its own right. L.A. would continue its ascendance in the ensuing decades. Per Google Books data, it entered a virtual tie with a San Francisco in the years after World War I, before pulling ahead shortly after World War II. In the second half of the 20th century, Los Angeles was the clear favorite, although San Francisco has obviously remained an important city. In fact, the gap has narrowed in recent years, possibly due to San Francisco’s utter dominance of the technology industry.

To drill deeper into the last two decades, we can move beyond Google Books data, and look at web traffic.

Interestingly, the above graph’s trend is in seeming conflict with our previous dataset. Whereas Google Books data showed the gap between usage of the two terms narrowing in the last two decades, the above graphs shows Los Angeles (red) widening the gap over San Francisco since 2004. (There is, of course, no reason that trends about the relative use of terms must be consistent among published works and online searches, but it is somewhat surprising.)

As the graph shows, the search terms were essentially tied from 2004-2008, with either city name likely to be searched more in a given month. Since 2009, Los Angeles has been the clear victor, and the margin has increased over time. In fact, since January 2009, there was only one month when San Francisco did manage to out-search its southern neighbor: October 2010, coinciding with the San Francisco Giants’s playoff and World Series run, which culminated in their winning baseball’s championship (technically, they won the final game on November 1).

Tracking the trends over time, we can see the increasing dominance of Los Angeles:

Within the entire dataset since 2004, Los Angeles is the clear victor, but there are 12 states in which “San Francisco” was searched more frequently — largely New England states and those with proximity to Northern California. When you look at just the last five years, however, 10 of those states have flipped, and only Oregon and Vermont remain in San Francisco’s camp.

Note: In case you are wondering about San Diego and San Jose — both of which are actually more populous than the city of San Francisco — the results are mixed. San Jose never really comes close to either L.A. or San Francisco by any measure. But when it comes to search data, San Diego doesn’t just outstrip San Francisco — it often bests L.A! Look at the map for the last year:

San Diego’s performance has actually slacked a bit, but even in the past 12 months, nine states — including California — have favored “San Diego,” with only a single state — Vermont — going to San Francisco. The final 40 went to L.A.