Mysql takes longer when using php or python compared to worbench queries



  • Versions: MySQL Community Server: 8.0.16 in Windows server (Configuration file: unknow)

    Workbench: 8.0

    Problem:

    When I make a query through workbench, it takes 1 second but when I make a query through PHP or Python, it lasts 30 seconds and the state in which it appears in the Worbench connections is: "sending data". The engine tables I consult is MyISAM.

    The response of query is too short this is the problem.

    Update

    I tried to use MariaDB with same tables and the response time between the workbench and the programming languages are almost similar...



  • UIs (such as Workbench) silent tack on a LIMIT to constrain the amount of output. This speeds up certain queries. I suspect this explains the alleged difference.

    Running the 'same' (or, in some cases, 'similar') twice in a row -- the second one may be much faster than the first. This is due to "caching". Run your queries both ways again.

    I suggest you look at SHOW CREATE TABLE; you may find that the table is not really ENGINE=MyISAM. 8.0 is seriously deprecating that old Engine. I recommend you take the hint and move to InnoDB.

    "long it takes to bring the data" -- That sounds like it includes the web page rendering. Instead, add code to actually capture the time before and after.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2