Showing posts with label reads. Show all posts
Showing posts with label reads. Show all posts

Wednesday, March 28, 2012

Inventory system.. Reads and writes

How does one go about building a highly transactional inventory system where
one goes about searching , adding and decrementing inventory..?
Can one share their high level architectural design ?
I am afraid of intensive blocking . When one goes about buying an item from
an inventory, how do you prevent others from not seeing it or even buying it
?
Would really love to hear how this is implemented ?Hassan,
Check the inventory models here:
http://www.databaseanswers.org/data_models/index.htm for a start.
Dejan Sarka, SQL Server MVP
Mentor, www.SolidQualityLearning.com
Anything written in this message represents solely the point of view of the
sender.
This message does not imply endorsement from Solid Quality Learning, and it
does not represent the point of view of Solid Quality Learning or any other
person, company or institution mentioned in this message
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%234ZWLrqOGHA.1088@.tk2msftngp13.phx.gbl...
> How does one go about building a highly transactional inventory system
> where one goes about searching , adding and decrementing inventory..?
> Can one share their high level architectural design ?
> I am afraid of intensive blocking . When one goes about buying an item
> from an inventory, how do you prevent others from not seeing it or even
> buying it ?
> Would really love to hear how this is implemented ?
>
>
>|||Well I guess I was looking for scalability and concurrency issues
surrounding that. With everyone hitting the same one or 2 tables, how can i
ensure there is no blocking along with the fact that I can have a 1000 +
users concurrently viewing the inventory while inventory is being
decremented when a customer buys the item and inventory is incremented when
more items are reordered. And make sure no 2 people also book the same 1
item say as an example thats available..
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:%23ZOTrjxOGHA.720@.TK2MSFTNGP14.phx.gbl...
> Hassan,
> Check the inventory models here:
> http://www.databaseanswers.org/data_models/index.htm for a start.
> --
> Dejan Sarka, SQL Server MVP
> Mentor, www.SolidQualityLearning.com
> Anything written in this message represents solely the point of view of
> the sender.
> This message does not imply endorsement from Solid Quality Learning, and
> it does not represent the point of view of Solid Quality Learning or any
> other person, company or institution mentioned in this message
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%234ZWLrqOGHA.1088@.tk2msftngp13.phx.gbl...
>

Inventory system.. Reads and writes

How does one go about building a highly transactional inventory system where
one goes about searching , adding and decrementing inventory..?
Can one share their high level architectural design ?
I am afraid of intensive blocking . When one goes about buying an item from
an inventory, how do you prevent others from not seeing it or even buying it
?
Would really love to hear how this is implemented ?Hassan,
Check the inventory models here:
http://www.databaseanswers.org/data_models/index.htm for a start.
--
Dejan Sarka, SQL Server MVP
Mentor, www.SolidQualityLearning.com
Anything written in this message represents solely the point of view of the
sender.
This message does not imply endorsement from Solid Quality Learning, and it
does not represent the point of view of Solid Quality Learning or any other
person, company or institution mentioned in this message
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%234ZWLrqOGHA.1088@.tk2msftngp13.phx.gbl...
> How does one go about building a highly transactional inventory system
> where one goes about searching , adding and decrementing inventory..?
> Can one share their high level architectural design ?
> I am afraid of intensive blocking . When one goes about buying an item
> from an inventory, how do you prevent others from not seeing it or even
> buying it ?
> Would really love to hear how this is implemented ?
>
>
>|||Well I guess I was looking for scalability and concurrency issues
surrounding that. With everyone hitting the same one or 2 tables, how can i
ensure there is no blocking along with the fact that I can have a 1000 +
users concurrently viewing the inventory while inventory is being
decremented when a customer buys the item and inventory is incremented when
more items are reordered. And make sure no 2 people also book the same 1
item say as an example thats available..
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:%23ZOTrjxOGHA.720@.TK2MSFTNGP14.phx.gbl...
> Hassan,
> Check the inventory models here:
> http://www.databaseanswers.org/data_models/index.htm for a start.
> --
> Dejan Sarka, SQL Server MVP
> Mentor, www.SolidQualityLearning.com
> Anything written in this message represents solely the point of view of
> the sender.
> This message does not imply endorsement from Solid Quality Learning, and
> it does not represent the point of view of Solid Quality Learning or any
> other person, company or institution mentioned in this message
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%234ZWLrqOGHA.1088@.tk2msftngp13.phx.gbl...
>> How does one go about building a highly transactional inventory system
>> where one goes about searching , adding and decrementing inventory..?
>> Can one share their high level architectural design ?
>> I am afraid of intensive blocking . When one goes about buying an item
>> from an inventory, how do you prevent others from not seeing it or even
>> buying it ?
>> Would really love to hear how this is implemented ?
>>
>>
>

Inventory system.. Reads and writes

How does one go about building a highly transactional inventory system where
one goes about searching , adding and decrementing inventory..?
Can one share their high level architectural design ?
I am afraid of intensive blocking . When one goes about buying an item from
an inventory, how do you prevent others from not seeing it or even buying it
?
Would really love to hear how this is implemented ?
Hassan,
Check the inventory models here:
http://www.databaseanswers.org/data_models/index.htm for a start.
Dejan Sarka, SQL Server MVP
Mentor, www.SolidQualityLearning.com
Anything written in this message represents solely the point of view of the
sender.
This message does not imply endorsement from Solid Quality Learning, and it
does not represent the point of view of Solid Quality Learning or any other
person, company or institution mentioned in this message
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%234ZWLrqOGHA.1088@.tk2msftngp13.phx.gbl...
> How does one go about building a highly transactional inventory system
> where one goes about searching , adding and decrementing inventory..?
> Can one share their high level architectural design ?
> I am afraid of intensive blocking . When one goes about buying an item
> from an inventory, how do you prevent others from not seeing it or even
> buying it ?
> Would really love to hear how this is implemented ?
>
>
>
|||Well I guess I was looking for scalability and concurrency issues
surrounding that. With everyone hitting the same one or 2 tables, how can i
ensure there is no blocking along with the fact that I can have a 1000 +
users concurrently viewing the inventory while inventory is being
decremented when a customer buys the item and inventory is incremented when
more items are reordered. And make sure no 2 people also book the same 1
item say as an example thats available..
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in
message news:%23ZOTrjxOGHA.720@.TK2MSFTNGP14.phx.gbl...
> Hassan,
> Check the inventory models here:
> http://www.databaseanswers.org/data_models/index.htm for a start.
> --
> Dejan Sarka, SQL Server MVP
> Mentor, www.SolidQualityLearning.com
> Anything written in this message represents solely the point of view of
> the sender.
> This message does not imply endorsement from Solid Quality Learning, and
> it does not represent the point of view of Solid Quality Learning or any
> other person, company or institution mentioned in this message
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%234ZWLrqOGHA.1088@.tk2msftngp13.phx.gbl...
>
sql

Sunday, February 19, 2012

Interpreting Statistics IO

This is my orignal statistics io return:
Table 'MyTable'. Scan count 1, logical reads 4338, physical reads 0, read-
ahead reads 0.
This is my revised statistics io return:
Table 'MyTable'. Scan count 117, logical reads 536, physical reads 0, read-
ahead reads 0.
Do I view this as an improvement since the logical reads reduced? Profiler
shows a large reduction in duration and reads when comparing the original to
the revised. The Scan count grew substantially, yet the logical reads droppe
d
substantially. Based upon Profiler my assumption is that the logical reads
reduction is the best indicator. True?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200606/1> Based upon Profiler my assumption is that the logical reads
> reduction is the best indicator. True?
Yes. Logical reads is as close as you can get to seeing how much SQL Server
had to actualy hit the hard drive. The only reason "Physical Reads" are zero
is because the data your query needed is already in the SQL Server data
cache.
You could run
DBCC DROPCLEANBUFFERS
to empty the cache, forcing SQL Server to actually hit the hard drive, and
you'd see how slow your query really could take.
But hard drive access is everything.|||Compare to a query that i wish i could make faster:
Table 'Worktable'. Scan count 155, logical reads 16039, physical reads 0,
read-ahead reads 0.
Table 'Patrons'. Scan count 4, logical reads 12, physical reads 0,
read-ahead reads 0.
Table 'Transactions'. Scan count 24242, logical reads 114968, physical reads
0, read-ahead reads 0.
Table 'Transactions'. Scan count 24242, logical reads 194430, physical reads
0, read-ahead reads 0.
Table 'Windows'. Scan count 1566, logical reads 3132, physical reads 0,
read-ahead reads 0.
Table 'Sessions'. Scan count 1566, logical reads 9396, physical reads 0,
read-ahead reads 0.
Table 'LCTTransactions'. Scan count 13084, logical reads 39312, physical
reads 0, read-ahead reads 0.
Table 'LCTTransactions'. Scan count 13084, logical reads 26412, physical
reads 0, read-ahead reads 0.
Table 'LCTs'. Scan count 4, logical reads 40, physical reads 0, read-ahead
reads 0.
Table 'LCTs'. Scan count 4, logical reads 372, physical reads 0, read-ahead
reads 92.
Table 'Worktable'. Scan count 135, logical reads 14779, physical reads 0,
read-ahead reads 0.|||Thanks Ian.
For further clarification on the relation to Reads shown in Profiler and the
logical and physical reads listed for the same procedure in Statistics IO, i
t
appears the Reads shown in Profiler are greater than the sum of the logical
and physical reads produced for the same procedure in Statistics IO. Is
Profiler showing reads against System tables whereas Statistics IO does not?
Ian Boyd wrote:
>Yes. Logical reads is as close as you can get to seeing how much SQL Server
>had to actualy hit the hard drive. The only reason "Physical Reads" are zer
o
>is because the data your query needed is already in the SQL Server data
>cache.
>You could run
>DBCC DROPCLEANBUFFERS
>to empty the cache, forcing SQL Server to actually hit the hard drive, and
>you'd see how slow your query really could take.
>But hard drive access is everything.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200606/1|||> Is
> Profiler showing reads against System tables whereas Statistics IO does not?[/vbco
l]
Yes. Also, STATISTICS IO doesn't show I/O performed by scalar UDFs.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"cbrichards via droptable.com" <u3288@.uwe> wrote in message news:616e5ea2a1085@.uwe...[vbcol
=seagreen]
> Thanks Ian.
> For further clarification on the relation to Reads shown in Profiler and t
he
> logical and physical reads listed for the same procedure in Statistics IO,
it
> appears the Reads shown in Profiler are greater than the sum of the logica
l
> and physical reads produced for the same procedure in Statistics IO. Is
> Profiler showing reads against System tables whereas Statistics IO does no
t?
> Ian Boyd wrote:
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200606/1

Interpreting Statistics IO

This is my orignal statistics io return:
Table 'MyTable'. Scan count 1, logical reads 4338, physical reads 0, read-
ahead reads 0.
This is my revised statistics io return:
Table 'MyTable'. Scan count 117, logical reads 536, physical reads 0, read-
ahead reads 0.
Do I view this as an improvement since the logical reads reduced? Profiler
shows a large reduction in duration and reads when comparing the original to
the revised. The Scan count grew substantially, yet the logical reads dropped
substantially. Based upon Profiler my assumption is that the logical reads
reduction is the best indicator. True?
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200606/1> Based upon Profiler my assumption is that the logical reads
> reduction is the best indicator. True?
Yes. Logical reads is as close as you can get to seeing how much SQL Server
had to actualy hit the hard drive. The only reason "Physical Reads" are zero
is because the data your query needed is already in the SQL Server data
cache.
You could run
DBCC DROPCLEANBUFFERS
to empty the cache, forcing SQL Server to actually hit the hard drive, and
you'd see how slow your query really could take.
But hard drive access is everything.|||Compare to a query that i wish i could make faster:
Table 'Worktable'. Scan count 155, logical reads 16039, physical reads 0,
read-ahead reads 0.
Table 'Patrons'. Scan count 4, logical reads 12, physical reads 0,
read-ahead reads 0.
Table 'Transactions'. Scan count 24242, logical reads 114968, physical reads
0, read-ahead reads 0.
Table 'Transactions'. Scan count 24242, logical reads 194430, physical reads
0, read-ahead reads 0.
Table 'Windows'. Scan count 1566, logical reads 3132, physical reads 0,
read-ahead reads 0.
Table 'Sessions'. Scan count 1566, logical reads 9396, physical reads 0,
read-ahead reads 0.
Table 'LCTTransactions'. Scan count 13084, logical reads 39312, physical
reads 0, read-ahead reads 0.
Table 'LCTTransactions'. Scan count 13084, logical reads 26412, physical
reads 0, read-ahead reads 0.
Table 'LCTs'. Scan count 4, logical reads 40, physical reads 0, read-ahead
reads 0.
Table 'LCTs'. Scan count 4, logical reads 372, physical reads 0, read-ahead
reads 92.
Table 'Worktable'. Scan count 135, logical reads 14779, physical reads 0,
read-ahead reads 0.|||Thanks Ian.
For further clarification on the relation to Reads shown in Profiler and the
logical and physical reads listed for the same procedure in Statistics IO, it
appears the Reads shown in Profiler are greater than the sum of the logical
and physical reads produced for the same procedure in Statistics IO. Is
Profiler showing reads against System tables whereas Statistics IO does not?
Ian Boyd wrote:
>> Based upon Profiler my assumption is that the logical reads
>> reduction is the best indicator. True?
>Yes. Logical reads is as close as you can get to seeing how much SQL Server
>had to actualy hit the hard drive. The only reason "Physical Reads" are zero
>is because the data your query needed is already in the SQL Server data
>cache.
>You could run
>DBCC DROPCLEANBUFFERS
>to empty the cache, forcing SQL Server to actually hit the hard drive, and
>you'd see how slow your query really could take.
>But hard drive access is everything.
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200606/1|||> Is
> Profiler showing reads against System tables whereas Statistics IO does not?
Yes. Also, STATISTICS IO doesn't show I/O performed by scalar UDFs.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message news:616e5ea2a1085@.uwe...
> Thanks Ian.
> For further clarification on the relation to Reads shown in Profiler and the
> logical and physical reads listed for the same procedure in Statistics IO, it
> appears the Reads shown in Profiler are greater than the sum of the logical
> and physical reads produced for the same procedure in Statistics IO. Is
> Profiler showing reads against System tables whereas Statistics IO does not?
> Ian Boyd wrote:
>> Based upon Profiler my assumption is that the logical reads
>> reduction is the best indicator. True?
>>Yes. Logical reads is as close as you can get to seeing how much SQL Server
>>had to actualy hit the hard drive. The only reason "Physical Reads" are zero
>>is because the data your query needed is already in the SQL Server data
>>cache.
>>You could run
>>DBCC DROPCLEANBUFFERS
>>to empty the cache, forcing SQL Server to actually hit the hard drive, and
>>you'd see how slow your query really could take.
>>But hard drive access is everything.
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200606/1