Why the time is different for the same sql stament?

The stament:
select * from market m;

first try, the mean stament time 1.1s

about 20 min later, the mean time 31.8ms


why it showed so different?

The most likely answer is contention, could you include the contention column as well?

We don’t have an EXPLAIN from the quicker query to compare so I can only speculate here, but in the graphic you provided, it appears that Node 10 was the one you were connected to (the gateway node), but Node 20 was the node that held the lease for the data being pulled by the SELECT, so a network hop was necessary to complete the request.

When it was quicker, it was possible that the lease holder of the data and the gateway node was one and the same node so no network hops were required.

1 Like