Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are several reasons why the query return "wrong" or "not expected" result set:</p> <ol> <li>"Wrong" data were added to the database/table.</li> <li>Query reads uncommitted records or phantom records (see database levels of isolation)</li> <li>Your data may not be indexed yet (in case of fulltext index) or fulltext service is rebuilding the index</li> <li>There is no ORDER BY clause in the query and the system is high-loaded. In this case we may observe "merry-go-round scanning":</li> </ol> <blockquote> <p>For example, assume that you have a table with 500,000 pages. UserA executes a Transact-SQL statement that requires a scan (and retrieve some records) of the table. When that scan has processed 100,000 pages, UserB executes another Transact-SQL statement that scans the same table. The Database Engine schedules one set of read requests for pages after 100,001, and passes the rows from each page back to both scans. When the scan reaches the 200,000th page, UserC executes another Transact-SQL statement that scans the same table. Starting with page 200,001, the Database Engine passes the rows from each page it reads back to all three scans. After it reads the 500,000th row, the scan for UserA is complete, and the scans for UserB and UserC wrap back and start to read the pages starting with page 1. When the Database Engine gets to page 100,000, the scan for UserB is completed. The scan for UserC then keeps going alone until it reads page 200,000. At this point, all the scans have been completed. More about this optimization here: <a href="http://msdn.microsoft.com/en-us/library/ms191475.aspx" rel="nofollow">merry-go-round scanning</a></p> </blockquote> <ol> <li>In case of distributed databases, query could be performed on different copies of the database (because of "database load balancer"). So, during replication procedure some database copies may have different data at some point.</li> </ol> <p>If some other ideas comes up - I'll update my post.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload