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

  • SEARCH
  • Home
  • 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 8435471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:55:28+00:00 2026-06-10T06:55:28+00:00

Consider the following query executed in PostgreSQL 9.1 (or 9.2): SELECT * FROM foo

  • 0

Consider the following query executed in PostgreSQL 9.1 (or 9.2):

SELECT * FROM foo WHERE bar = true

Suppose it’s a fairly long running query (e.g. taking a minute).

If at the start of the query there are 5 million records for which bar = true holds, and during this query in another transaction there are rows added and removed in the foo table, and for some existing rows updates are made to the bar field.

Will any of this affect the outcome of the above shown select query?

I know about transaction-isolation and visibility between separate statements in a single transaction, but what about a single statement that’s running?

  • 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-06-10T06:55:30+00:00Added an answer on June 10, 2026 at 6:55 am

    No.
    Due to the MVCC model only tuples that are visible at query start will be used in a single SELECT. Details in the manual here:

    Read Committed is the default isolation level in PostgreSQL. When a
    transaction uses this isolation level, a SELECT query (without a FOR
    UPDATE/SHARE clause) sees only data committed before the query began;
    it never sees either uncommitted data or changes committed during
    query execution by concurrent transactions
    . In effect, a SELECT query
    sees a snapshot of the database as of the instant the query begins to
    run. However, SELECT does see the effects of previous updates executed
    within its own transaction, even though they are not yet committed.
    Also note that two successive SELECT commands can see different data,
    even though they are within a single transaction, if other
    transactions commit changes during execution of the first SELECT.

    Emphasis mine.

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

Sidebar

Related Questions

Consider the following query in PostgreSQL: SELECT a, b, (A VERY LONG AND COMPLICATED
Consider the following query in HQL: SELECT m.id, (SELECT (COUNT(*) > 0) FROM SubqueryTable...)
Consider the following query: SELECT operation, [...] FROM tableName The operation field will retrieve
Please consider the following: $query = SELECT legIDs FROM trip; $result = mysql_query($query) or
Consider the following SQL Server 2005/2008 query: Select [UID], [DESC] From SomeTable Order By
Please consider the following query: SELECT artist.id, COUNT(DISTINCT artist$styles.v_id) FROM artist LEFT JOIN artist$styles
Consider the following query: SELECT domain, done FROM tasks WHERE 1 GROUP BY domain
Please consider following sample query SELECT * FROM subscriber WHERE subscription_date>DATE(NOW()-INTERVAL 10 DAY) My
Consider the following criteria query: var x = SomeCriteria.AddOrder(new Order(Name, true)).List(); This will order
Consider the following 3 standard statements $queryString = SOME SQL SELECT QUERY; $queryResult =

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.