On Wednesday, 23 June 2021 at 09:52:25 UTC+10, Derek Ignatius Asirvadem wrote:What does normal GUI interaction mean to you ? Why does it exclude database interaction ? Why would you NOT restrict the user to choosing only those Parts that do exist in the database, and to a purchase quantity that is currently in stock ? Otherwise the GUI is insane, the user interaction is insane.
On Tuesday, 22 June 2021 at 20:35:05 UTC+10, Nicola wrote:
On 2021-06-19, Derek Ignatius Asirvadem wrote:
______
Client
There is ordinary interplay between the Client and the Server. The client may now be a GUI or a webpage or middleware in an app server.
The VALIDATE block [1] is repeated in the client.
I assume that this means validating data without interacting with the database, e.g., to check that the input data is within valid ranges,
etc.
No.
Any GUI or input system has to do those checks on input fields, that is fundamental, not usually mentioned.
LetrCOs say there are 20 WIDGETS currently in the inventory:
__ why would you allow an user to purchase 6 WIJJETS [that do not exist] ??? __ Why would you allow an user to purchase 100 WIDGETS [that are not in stock] ???
OTOH, if you are concerned about data in the database changing between
the point in the VALIDATE block that checks a particular row, and the
point the EXECUTE block that updates the relevant row, then yes, that
is not catered for in the above description. However, that [and one
other condition) is covered by Optimistic Locking.
OLAP ReportsWhy do you worry about locks in OLAP reports ?
Who cares.
Read locks are extremely short, and transient (held for the duration
of the read operation [Statement], not the Transaction). We canrCOt control Read
locks, even implicitly
Are you saying that OLAP queries run in a lower isolation level (say,
READ COMMITTED)?
Of course. That is what that ISOLATION LEVEL[ READ COMMITTED ] is there for.
Not just OLAP queries, but all SELECTs outside a Transaction. That [ISOLATION LEVEL] is an ANSI SQL requirement, within the ACID
requirement. We exclude [wait for completion of] uncommitted changes,
but we do not need SERIALISED, in fact we want massively parallel, and
we want the whole result set to be integral within itself (all
internal dependencies intact and true).
For understanding. Many systems in the MS world do their OLAP queries
with READ UN-COMMITTED, to avoid Read Locks, but that means (a) the
result set has no integrity, and (b) contains uncommitted changes
which may disappear.
For the MVCC world, they have no concept of READ
COMMITTED/UNCOMMITTED, because they have only the false privatised
version of the entire database, firmly secured between their big toes,
which has only nominally rCLcommittedrCY changes, that has no relation to
the version of other users. That nominally rCLcommittedrCY data blows up
at COMMIT TRAN, just check the PooGres manuals re all the problems
that are not supposed to happen in the Stonebraker fantasy, that
happen, even to people who dutifully sing the mantra.
But still, that is not Optimistic Locking. And in this post, there is
nothing about Optimistic Locking.
Agreed.
Add Optimistic Locking, and the methods given in this thread would be complete.
On Thursday, 24 June 2021 at 07:59:50 UTC+10, Nicola wrote:Sorry. Before I respond to the content, I need one clarification.
On 2021-06-22, Derek Ignatius Asirvadem wrote:
What rCLtransaction startedrCY ??? No transaction is involved.For understanding. Many systems in the MS world do their OLAP queries
with READ UN-COMMITTED, to avoid Read Locks, but that means (a) the
result set has no integrity, and (b) contains uncommitted changes
which may disappear.
Correct. But queries at READ COMMITTED may view (committed) changes that were not there when the transaction started.
Nicola
On Thursday, 24 June 2021 at 07:59:50 UTC+10, Nicola wrote:
On 2021-06-22, Derek Ignatius Asirvadem wrote:
Sorry. Before I respond to the content, I need one clarification.
For understanding. Many systems in the MS world do their OLAP queries
with READ UN-COMMITTED, to avoid Read Locks, but that means (a) the
result set has no integrity, and (b) contains uncommitted changes
which may disappear.
Correct. But queries at READ COMMITTED may view (committed) changes that
were not there when the transaction started.
What rCLtransaction startedrCY ??? No transaction is involved.
The report connection would normally do SELECT [at] READ_COMMITTED
which holds ReadLocks for the duration of the Statement,
Separately. What rCLrows that were not there [when the transaction started]rCY ??? How can a transaction change a row that is not there
???
Or even have knowledge about a row that is not there ???
On 2021-06-24, Derek Ignatius Asirvadem <derek.a...@gmail.com> wrote:Hi Nicola,
Nicola
On Thursday, 24 June 2021 at 07:59:50 UTC+10, Nicola wrote:
On 2021-06-22, Derek Ignatius Asirvadem wrote:
Sorry. Before I respond to the content, I need one clarification.
For understanding. Many systems in the MS world do their OLAP queries >> > with READ UN-COMMITTED, to avoid Read Locks, but that means (a) the
result set has no integrity, and (b) contains uncommitted changes
which may disappear.
Correct. But queries at READ COMMITTED may view (committed) changes that >> were not there when the transaction started.
What rCLtransaction startedrCY ??? No transaction is involved.Ok, now that is clear.
The report connection would normally do SELECT [at] READ_COMMITTEDOk. So, I am back to a question I have already posed to you:
which holds ReadLocks for the duration of the Statement,
- OLAP queries run at READ COMMITTED;
- Each OLAP query is a single SELECT statement;
- Each SELECT holds read locks for the duration of the statement.
But the duration of the statement may be significant (minutes, hours,
...) Don't such queries create contention (other transactions cannot
update the data read by the OLAP query until the query is over)?
Separately. What rCLrows that were not there [when the transaction started]rCY ??? How can a transaction change a row that is not thereOf course it can't.
???
Or even have knowledge about a row that is not there ???Of course it can't. But it can see something that was not there before,
and it appears at a later time. I explain what I mean with an example:
Time Transaction Operation
0 T1,T2 start transaction;
1 T1 select sum(X) from R;
2 T2 insert into R(X) values (100);
3 T2 commit;
4 T1 select sum(X) from R;
At READ COMMITTED, T1 at time 4 will see the record inserted by T2 at
time 2, even if the record did non exist when T1 began. The SELECT at
time 1 and time 4 would then return different results.
Of course, this is not an issue if the only queries you run at READ COMMITTED are single statementsrCoprovided that the system guarantees statement-level consistency (it seems that some don't: https://stackoverflow.com/questions/4772475/read-committed-isolation-level-in-sql-server-for-a-single-statement).
Nicola
Hi Nicola,
Importantly, and often overlooked as far as MVCC disadvantages go, the
data you read in an hours-long query running under MVCC is arbitrarily
old data. If your query takes 2 hours to complete then the very last
row processed by your query is potentially 2 hours out of date.
I have just repeated my experiment. The above query takes ~2.4s with
cold data and ~800ms with hot data on my laptop.
On Saturday, 26 June 2021 at 06:25:28 UTC+10, Nicola wrote:Yes !
On 2021-06-24, Daniel Loth wrote:
Hi Daniel,
great to see someone else diving in! I hope you will last :)
But if Derek can keep all his queries under 12 seconds with an old (asSorry if I wasn't clear. Almost all my SELECTs, complex or not, execute sub-second. Almost all even at customer sites. The problem is, on their production system, even though I am hired to reconfigure it, I rarely get the power to change everything that requires correction, there is always some area (eg. SAN config) or some config parm (eg. auditing set up) that I cannot change. Thus I have a few SELECTs on customer systems, that take more than 1 sec, which I remember them well, the worst one being 12 secs.
in "mature") 2PC system
2PCNo.
If an update causes a page split in the clustered index, resulting in rows being moved to new pages, then this will necessitate updating all non-clustered indexes (because non-clustered indexes contain the clustered index key).
Trivially, as MVCC does not use locks.
Are you agreeing that MV-non-CC cannot support SQL/ACID ? Finally, hallelujah !!!
I have just repeated my experiment. The above query takes ~2.4s with
cold data and ~800ms with hot data on my laptop. Ok, that's flash
storage and a laptop one decade newer than the one in your document. But
it's stock PostgreSQL with default parameters (which are extremely
conservative), with no physical tuning applied.
Excellent. The rCyhotrCO figure is the one we want (test is logical not physical I/O).
Now if we bring it back to the context of locking vs MV-non-CC, run:
__ 10 x OLTP Transactions doing UPDATE CustomerTransaction randomly, and
__ 5 of those SELECTs
__ concurrently.
My questions are for
better understanding on my part, not to tell you that you should run
things differently.
But that is not what I meant, what >>I<< did is not relevant. Given
your [then] concern re Read Locks, and such being held for some
duration, and such contending with OLTP Transactions, you may be
interested in what that actually looks like, in terms of metrics in
a production server.
To proceed with this thread then:
__ generally an understanding of OLTP, that is the LARGE SHARED DATA
BANK context, rather than mere speed in a single-user context,
__ hopefully resolve my declaration that PissGriss does not support ACID
__ (ie. any MV-non-CC system cannot support ACID)
____ and therefore cannot provide OLTP
__ the two items that remain from my side:
___1 there are two major occurrences in OLTP that have not been
mentioned yet, that must be covered before we can consider this
subject complete (MV-non-CC types are totally ignorant about this)
___2 Optimistic Locking. We are dancing around it, without confirming
its absolute need in OLTP.
Although you have no further questions re the Batch Transaction, that understanding is not complete, it can be completed only when the above outstanding elements are completed.
Can you elaborate on that? Do you mean that MVCC works well only whenYes, happy to elaborate by way of anecdote.
your goal is to micro-optimize, but it is not suitable to obtain
system-wide good performance?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 10:48:11 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
3 files (7,546K bytes) |
| Messages: | 265,193 |