Skip to Content
Advanced MySQL 8
book

Advanced MySQL 8

by Eric Vanier, Birju Shah, Tejaswi Malepati
January 2019
Intermediate to advanced
286 pages
7h 41m
English
Packt Publishing
Content preview from Advanced MySQL 8

Using prepared statements if and when possible

It is recommended to use prepared statements for all those queries that are frequently used for better performance. For example, as we discussed in earlier sections, for a login call, the read query is the same for any number of users, so even though caching increases the performance of turn-around latency, this prepared statement will enhance it further, because the payload size is smaller when the client is making that call to the MySQL database, thus reducing the network packet size indirectly, therefore enhancing performance and reducing latency.

The syntax of the prepared statement is as follows:

PREPARE <name of prepared statement> FROM '<SQL statement to be prepared>';

The following diagram ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL 8 Cookbook

MySQL 8 Cookbook

Karthik Appigatla
High Performance MySQL, 3rd Edition

High Performance MySQL, 3rd Edition

Baron Schwartz, Peter Zaitsev, Vadim Tkachenko
High Performance MySQL, 2nd Edition

High Performance MySQL, 2nd Edition

Jeremy D. Zawodny, Derek J. Balling, Baron Schwartz, Peter Zaitsev, Arjen Lentz, Vadim Tkachenko

Publisher Resources

ISBN: 9781788834445Other