I'm developer a system, and the database was not made for me. In the beginning all query of the database are super fast, because i don't have any data. Along the project the database grown, but the performance decreased. When the client access a page of the site, the system will require a page on database. As a user of web-browser, everybody wants that page load as soon as possible. But today this query is take like 7,5 seconds:
So my page will load my article, at last with 7,3 seconds minimum (This query was made with no users accessing the database, only me). For a web-user, this is a eternity.
I really wants know, what exactly causes the PostgreSQL take this time to get my query. I make my research, and some people say the size of the database and the number of rows doesnt matter. I know what's is B* and Hash Table, but i really don't know how to understand why it's taking 7 seconds to make a simple select.
What i want to understand what delay a query, like a simple select? Is the number of rows? The size of the tables?
Seq Scan on article_article (cost=0.00..1151560.85 rows=1 width=14) (actual time=6727.343..6733.021 rows=1 loops=1) Filter: ((title)::text = 'Brazil'::text) Rows Removed by Filter: 5655059 Planning time: 0.134 ms Execution time: 6733.050 ms (5 rows)