If we look at Old Towns of European cities, we can see that there are many churches in them. Of course, it is reasonable as religion was very important in lives of the medieval people. However, comparing to old towns size, there are lots of them, sometimes one neighbouring another.
I prepared a map on Google
This was the capital city of Poland in medieval times, one of largest and richest in Europe. The green lane around the Old Town is called "Planty" and marks the medieval border of the city (city walls). I tried to mark all churches there, but I'm pretty sure some are missing. These are only Catholic churches, but Protestant and Orthodox do also exist. Some of them might be a bit newer (Renaissance), some of them are churches of Orders.
In Polish Wikipedia there are statistics of demography of Cracow. Until 19th century there were ca. 20 thousand inhabitants, reaching maximum in 1530 (30000). Of course these people did not live only inside city walls.
Today in the Stare Miasto district live 40545 people (source). The District area is however about 3-4 times larger than the Old Town itself, so let us assume that inside the City Walls lived about ten thousand people.
I marked 18 churches inside the city walls, which gives about 500 people per parish. This number is reasonable, however not when you realize that St. Mary church can hold about 3000 people at once (my own observation).
I assume that other cities in Europe have similar numbers.
What was the reason of building such large churches with such density? Was it only ad maiorem Dei gloriam?