0

I'm suspecting our Postgres DB has performance issue so I'm troubleshooting.

First I'm running a query below from my local laptop like below;

 "select * from table1"

And this table has 7 rows and it taks around 506 ms, seems slow.

enter image description here

So after then I run the query below;

 EXPLAIN ANALYZE select * from table1;

Output is below;

enter image description here

So if I'm correct, output says query took 0.008 second?

So how can I understand these values? Are these values ok?

Ps : Postgresql ver is 10.4 but I couldn't found the tag!

Thanks!

8
  • 1
    the query took 0.055ms + 0.021ms Commented Nov 25, 2021 at 8:40
  • Those are 0.008 milliseconds. Do you get the same results if you repeat the experiment? What is the network latency between client and server? Commented Nov 25, 2021 at 8:40
  • Your title is vague. And contains an important mispelling. Commented Nov 25, 2021 at 8:41
  • 2
    pgAdmin is known to be quite slow when it comes to displaying results. This is not a Postgres performance problem, but a pgAdmin problem. Commented Nov 25, 2021 at 8:46
  • Is that a cloud instance? Maybe Azure PostgreSQL on Basic subscription? Commented Nov 25, 2021 at 8:58

1 Answer 1

2

The difference must be network lag.

You could try with a query that does nothing really and see if you get a similar duration:

SELECT 1;

That should show the same duration and would confirm that there is a network latency of around 250 ms.

Sign up to request clarification or add additional context in comments.

4 Comments

Yes, it took around 250 ms, so basically that time means "query time+ the time to get data to the laptop(pgadmin)" ? Do you know what is the exact query time then? 0.008 ms or (planning time+execution time)?
The query took 0.076 milliseconds (planning + execution), the sequential scan 0.008 milliseconds.
To make it clear, that ~250ms, which I saw on Pgadmin after running a query means that "query time+ the time to get data to the laptop(pgadmin)"?
That's the time the client measures between sending the client to the server and receiving an answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.