0

I have a simple join query that returns ~5.7k records.

the results says:

/* Affected rows: 0  Found rows: 5,780  Warnings: 0  Duration for 1 query: 0.015 sec. (+ 5.438 sec. network) */

How can I reduce the "network" time i.e. 5.438 secs

EDIT: I got the result on HeidiSQL

I use ClearDB on Heroku

https://devcenter.heroku.com/articles/cleardb

Burcin
  • 973
  • 1
  • 9
  • 25
Angad Dubey
  • 5,067
  • 7
  • 30
  • 51
  • 6
    Use a shorter cable ;) – Michael Y. Oct 14 '15 at 18:46
  • Are you sure this really is the time it took to transfer the records over the wire ? Which backend do you use with HeidiSQL ? If it takes that much time to transfer I guess you have either a rather complex network setup or the network handshake takes too long. Try to verify with a different tool like dbVisualizer – Marged Oct 14 '15 at 18:49
  • @Marged I use the ClearDB addon on Heroku https://devcenter.heroku.com/articles/cleardb – Angad Dubey Oct 14 '15 at 18:50
  • My guess is that heidisql is mislead and thinks the time taken by heroku/cleardb to process your query is the network transfer time. But I am no specialist for either heroku or cleardb. I suggest you edit your question and add the appropriate tags AND the information that you use cleardb. Hopefully this will attract the right people. And some details about your network might help to see if it is complex enough to cause the problem – Marged Oct 14 '15 at 18:53
  • @Marged edited for more info – Angad Dubey Oct 14 '15 at 18:56
  • @maximl337, you can minimize selected columns. If you have larger row size it can take more time to fetch. – Burcin Oct 14 '15 at 19:20

1 Answers1

2

What you are talking here is about network latency. It can depend on many factors including servers, routers, switches, firewall, bandwidth etc. And as a developer most of the time we don't have enough information about the whole network. So this question can not be answered by not knowing the network structure.

But one suggestion that I can give you is, look at your query. Are you querying more data than you need? Try to minimize the amount of data that you are passing over network. Use queries smartly.

kazisami
  • 168
  • 9