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
I've been trying to use SQLite with the PDO wrapper in PHP with mixed
In our web-app we use PHP5.2.6 + PDO to connect to a SQL Server
Why can't I pass the table name to a prepared PDO statement? $stmt =
I'm using PDO after migrating away from the mysql library. What do I use
Possible Duplicate: PDO Prepared Statements I'm using the mysqli extension in PHP and I'm
I'm trying to write an iterator for results from a PDO statement but I
I am updating some code from the old mysql_* functions to PDO. It connects
I'm writing some DB routines and I'm using prepared statements. My environment is PDO
How can I detect, using php, if the machine has oracle (oci8 and/or pdo_oci)

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.