Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 971507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:58:35+00:00 2026-05-16T02:58:35+00:00

Are PDO transcations intended just for UPDATE, INSERT and DELETE or can you achieve

  • 0

Are PDO transcations intended just for UPDATE, INSERT and DELETE or can you achieve performance gains if you use a transaction for mulitple SELECT queries?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:58:35+00:00Added an answer on May 16, 2026 at 2:58 am

    From a purist point of view, it would be wrong to use a transaction on SELECT statements ‘to improve performance’. Use a transaction to be sure to not get inconsistencies in the data.

    From a performance point of view, locking the tables so no other statement can access it in order to speed up your SELECTs might work – but there are probably better solutions than that. For example, use the HIGH_PRIORITY attribute in your SELECT statement:

    HIGH_PRIORITY gives the SELECT higher
    priority than a statement that updates
    a table. You should use this only for
    queries that are very fast and must be
    done at once. A SELECT HIGH_PRIORITY
    query that is issued while the table
    is locked for reading runs even if
    there is an update statement waiting
    for the table to be free. This affects
    only storage engines that use only
    table-level locking (such as MyISAM,
    MEMORY, and MERGE).

    This way you use the appropriate method to reach the goal, instead of some hack about which other developers (or even a future you) will wonder why it exists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So after reading Performance in PDO / PHP / MySQL: transaction versus direct execution
Should I use php PDO or normal mysql_connect to execute database queries in PHP?
According to the PDO documentation , you can store database login details in php.ini,
I'm using PDO to insert a record (mysql and php) $stmt->bindParam(':field1', $field1, PDO::PARAM_STR); $stmt->bindParam(':field2',
Does some PDO::PARAM_??? exist which can be used for dates or timestamps? Sample code:
I want to use pdo in my application, but before that I want to
In my PDO implementation, I am attempting to use an inserted value in the
I am using PDO for the first time with MySQL, just playing with it
I'm using transactions with PHP's PDO and MySQL and I'm wondering how to select,
PHP PDO Singleton Class: <?php require_once('app/config.php'); // Require constants HOST, DATABASE, USER, PASSWORD /*

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.