Reputation: 394
I'm running a simple query on localhost PostgreSQL database and it runs too long:
SELECT * FROM features LIMIT 1;
I expect such query to be finished in a fraction of a second as it basically says "peek anywhere in the database and pick one row". Or it doesn't?
Upvotes: 3
Views: 6136
Reputation: 1358
I totally agree with @larwa1n with the content he comment on your post.
The reason here, I guess, is the performance of SELECT
is too slow.
With my experience maybe there are another reasons. I list as below:
WHERE CLAUSE
and INDEX
autovacuum
is running? If not, check is this table is vacuum
already? If not, let do a vacuum full
on that table. Sometimes, when you do a lot of insert/update/delete on a large table without vacuum
will make the table save in fragmented disk block, which will take longer time in query.Hopefully, this answer will help you find out the final reason.
Upvotes: 2