Query planners can (and will) use statistics gathered on the contents of the tables to more effectively execute queries, which can be gathered in the background/batch processes.
For large database vendors there is a good amount of complexity put into up-front information gathering so that query execution is fast.
For large database vendors there is a good amount of complexity put into up-front information gathering so that query execution is fast.