SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Internals of data insertion into the table


Internals of data insertion into the table

Author
Message
SQL*
SQL*
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1546 Visits: 1726
Hi,

When we insert the data into a table, what happened exactly(process)?

How the data will be inserted? For any modifications sql server uses t-log right? How the t-log will be committed to data pages?


Thanks,

:-)
sroos
sroos
SSC Veteran
SSC Veteran (247 reputation)SSC Veteran (247 reputation)SSC Veteran (247 reputation)SSC Veteran (247 reputation)SSC Veteran (247 reputation)SSC Veteran (247 reputation)SSC Veteran (247 reputation)SSC Veteran (247 reputation)

Group: General Forum Members
Points: 247 Visits: 240
The transaction log is used for all modifications to guarantee atomicity, durability and consistency. Read Gail's thorough article.

http://www.sqlservercentral.com/articles/Administration/64582/
GilaMonster
GilaMonster
SSC Guru
SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)

Group: General Forum Members
Points: 230564 Visits: 46346
The transaction log records aren't committed to data pages. The data modification is made to the data pages (in memory) and then logged into the transaction log. The only time you get replay from the log is in database recovery or restores (or on the mirror DB in database mirroring).

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


SQL*
SQL*
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1546 Visits: 1726
GilaMonster (9/25/2012)
The transaction log records aren't committed to data pages. The data modification is made to the data pages (in memory) and then logged into the transaction log. The only time you get replay from the log is in database recovery or restores (or on the mirror DB in database mirroring).



The data modification is made to the data pages (in memory) and then logged into the transaction log.

That means
1. Sql server fetches the table related data pages to memory (What is the memory in this case is it RAM?)
Q. How many pages will be fetched to Memory?
Q2. How does server knows that the pages are related to a table?

if i am wrong can u correct me, Can you tell me the process of insertion?

Thanks alot

:-)
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)

Group: General Forum Members
Points: 100207 Visits: 33014
There are scads and scads of processes that take place when you insert data. I'd suggest getting a copy of Kalen Delaney's book SQL Server Internals. That covers the process in wonderful detail much better than you're going to get in a simple forum post.

May I ask, what specifically are you trying to understand about it? Are you hitting some type of problem?

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
GilaMonster
GilaMonster
SSC Guru
SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)

Group: General Forum Members
Points: 230564 Visits: 46346
SQL* (9/25/2012)
Q. How many pages will be fetched to Memory?


As many as are needed for the query

Q2. How does server knows that the pages are related to a table?


In short, the allocation pages (or which there are many kinds) and the system tables.

Read Kalen's book, read Paul Randal's blog.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search