{"id":483,"date":"2012-06-03T00:00:04","date_gmt":"2012-06-02T22:00:04","guid":{"rendered":"http:\/\/www.sqlserver.fr\/blog\/?p=483"},"modified":"2026-05-02T14:31:12","modified_gmt":"2026-05-02T12:31:12","slug":"ou-est-mon-enregistrement","status":"publish","type":"post","link":"https:\/\/www.sqlserver.fr\/blog\/ou-est-mon-enregistrement\/","title":{"rendered":"O\u00f9 est mon enregistrement ?"},"content":{"rendered":"<p>Voici un petit article pr\u00e9sentant une fonction non document\u00e9e qui permet de localiser l&rsquo;endroit o\u00f9 est stock\u00e9e une ligne donn\u00e9e. Cela peut notamment permettre de situer les autres lignes pr\u00e9sentes dans la m\u00eame page, et qui pourraient subir les effets d&rsquo;un verrou de la page lors d&rsquo;une modification.<!--more--><\/p>\n<p>Pour rappel, les donn\u00e9es sont stock\u00e9es par SQL Server sous forme de pages de 8Ko. Cette taille est fixe; elle permet de comprendre certaines limites au niveau des types de donn\u00e9es (varchar(8000), nvarchar(4000), &#8230;), en sachant qu&rsquo;un enregistrement ne peut pas \u00eatre \u00e0 cheval sur plusieurs pages (hormis pour certains types qui peuvent \u00eatre stock\u00e9s en dehors de la ligne elle-m\u00eame).<\/p>\n<p>A partir de SQL Server 2008, une nouvelle colonne cach\u00e9e est disponible pour permettre de situer la page dans laquelle se trouve chacun des enregistrements retourn\u00e9s.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">select *,%%physloc%% as [%%physloc%%] from HumanResources.Department<\/pre>\n<p><a href=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-493\" title=\"Liste1\" src=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste1-620x300.png\" alt=\"\" width=\"620\" height=\"300\" srcset=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste1-620x300.png 620w, https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste1-300x145.png 300w, https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste1.png 728w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Bon, c&rsquo;est vrai, vu comme \u00e7a, ce n&rsquo;est pas tr\u00e8s parlant&#8230;<\/p>\n<p>Les 4 premiers octets correspondent \u00e0 l&rsquo;identifiant de page, puis 2 octets pour l&rsquo;identification du fichier, et enfin les deux derniers octets pour le slot, ce qui correspond en gros au num\u00e9ro d&rsquo;enregistrement dans la page.<\/p>\n<p>Heureusement pour d\u00e9crypter cela, nous avons aussi droit \u00e0 une magnifique fonction qui nous permet d&rsquo;avoir un affichage beaucoup plus lisible de la chose.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">select *,sys.fn_PhysLocFormatter(%%physloc%%) as [Emplacement] from HumanResources.Department<\/pre>\n<p><a href=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-494\" title=\"Liste2\" src=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste2-620x320.png\" alt=\"\" width=\"620\" height=\"320\" srcset=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste2-620x320.png 620w, https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste2-300x155.png 300w, https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Liste2.png 682w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Nous constatons ici que les divers enregistrement se situent tous sur la page 665 du premier fichier de ma base. Allons donc y jeter un oeil :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">dbcc page (8,1,665,1)<\/pre>\n<table style=\"border: 0px solid #000000;\" border=\"0\" frame=\"border\" align=\"left\">\n<tbody>\n<tr>\n<td><span style=\"font-size: xx-small;\">PAGE: (1:665)<\/span><br \/>\n<span style=\"font-size: xx-small;\">BUFFER:<\/span><br \/>\n<span style=\"font-size: xx-small;\">BUF @0x0000000085FDBE80<\/span><span style=\"font-size: xx-small;\">bpage = 0x00000000859FC000 bhash = 0x0000000000000000 bpageno = (1:665)<\/span><br \/>\n<span style=\"font-size: xx-small;\">bdbid = 8 breferences = 0 bcputicks = 0<\/span><br \/>\n<span style=\"font-size: xx-small;\">bsampleCount = 0 bUse1 = 16708 bstat = 0xc00009<\/span><br \/>\n<span style=\"font-size: xx-small;\">blog = 0x3212159 bnext = 0x0000000000000000<\/span><span style=\"font-size: xx-small;\">PAGE HEADER:<\/span><br \/>\n<span style=\"font-size: xx-small;\">Page @0x00000000859FC000<\/span><span style=\"font-size: xx-small;\">m_pageId = (1:665) m_headerVersion = 1 m_type = 1<\/span><br \/>\n<span style=\"font-size: xx-small;\">m_typeFlagBits = 0x0 m_level = 0 m_flagBits = 0x220<\/span><br \/>\n<span style=\"font-size: xx-small;\">m_objId (AllocUnitId.idObj) = 135 m_indexId (AllocUnitId.idInd) = 256 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Metadata: AllocUnitId = 72057594046775296 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Metadata: PartitionId = 72057594044612608 Metadata: IndexId = 1<\/span><br \/>\n<span style=\"font-size: xx-small;\">Metadata: ObjectId = 757577737 m_prevPage = (0:0) m_nextPage = (0:0)<\/span><br \/>\n<span style=\"font-size: xx-small;\">pminlen = 14 m_slotCnt = 16 m_freeCnt = 6456<\/span><br \/>\n<span style=\"font-size: xx-small;\">m_freeData = 1704 m_reservedCnt = 0 m_lsn = (41:2945:22)<\/span><br \/>\n<span style=\"font-size: xx-small;\">m_xactReserved = 0 m_xdesId = (0:1194) m_ghostRecCnt = 0<\/span><br \/>\n<span style=\"font-size: xx-small;\">m_tornBits = 263213638<\/span><span style=\"font-size: xx-small;\">Allocation Status<\/span><span style=\"font-size: xx-small;\">GAM (1:2) = ALLOCATED SGAM (1:3) = NOT ALLOCATED <\/span><br \/>\n<span style=\"font-size: xx-small;\">PFS (1:1) = 0x60 MIXED_EXT ALLOCATED 0_PCT_FULL DIFF (1:6) = CHANGED<\/span><br \/>\n<span style=\"font-size: xx-small;\">ML (1:7) = NOT MIN_LOGGED<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">DATA:<\/span><br \/>\n<span style=\"font-size: xx-small;\">Slot 0, Offset 0x60, Length 93, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 93 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A060<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 01000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 0002002d 005d0045 006e0067 0069006e \u2020&#8230;-.].E.n.g.i.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00650065 00720069 006e0067 00520065 \u2020.e.e.r.i.n.g.R.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00730065 00610072 00630068 00200061 \u2020.s.e.a.r.c.h. .a <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 006e0064 00200044 00650076 0065006c \u2020.n.d. .D.e.v.e.l <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 006f0070 006d0065 006e0074 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.o.p.m.e.n.t.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 1, Offset 0xbd, Length 93, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 93 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A0BD<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 02000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 0002002d 005d0054 006f006f 006c0020 \u2020&#8230;-.].T.o.o.l. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00440065 00730069 0067006e 00520065 \u2020.D.e.s.i.g.n.R.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00730065 00610072 00630068 00200061 \u2020.s.e.a.r.c.h. .a <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 006e0064 00200044 00650076 0065006c \u2020.n.d. .D.e.v.e.l <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 006f0070 006d0065 006e0074 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.o.p.m.e.n.t.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 2, Offset 0x11a, Length 71, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 71 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A11A<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 03000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020021 00470053 0061006c 00650073 \u2020&#8230;!.G.S.a.l.e.s <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00530061 006c0065 00730020 0061006e \u2020.S.a.l.e.s. .a.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00640020 004d0061 0072006b 00650074 \u2020.d. .M.a.r.k.e.t <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 0069006e 006700\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.i.n.g.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 3, Offset 0x161, Length 79, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 79 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A161<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 04000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020029 004f004d 00610072 006b0065 \u2020&#8230;).O.M.a.r.k.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00740069 006e0067 00530061 006c0065 \u2020.t.i.n.g.S.a.l.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00730020 0061006e 00640020 004d0061 \u2020.s. .a.n.d. .M.a <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 0072006b 00650074 0069006e 006700\u2020\u2020\u2020\u2020.r.k.e.t.i.n.g.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 4, Offset 0x1b0, Length 83, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 83 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A1B0<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 05000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 0002002b 00530050 00750072 00630068 \u2020&#8230;+.S.P.u.r.c.h <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00610073 0069006e 00670049 006e0076 \u2020.a.s.i.n.g.I.n.v <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 0065006e 0074006f 00720079 0020004d \u2020.e.n.t.o.r.y. .M <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 0061006e 00610067 0065006d 0065006e \u2020.a.n.a.g.e.m.e.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 007400\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.t.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 5, Offset 0x203, Length 119, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 119 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A203<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 06000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020047 00770052 00650073 00650061 \u2020&#8230;G.w.R.e.s.e.a <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00720063 00680020 0061006e 00640020 \u2020.r.c.h. .a.n.d. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00440065 00760065 006c006f 0070006d \u2020.D.e.v.e.l.o.p.m <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 0065006e 00740052 00650073 00650061 \u2020.e.n.t.R.e.s.e.a <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00720063 00680020 0061006e 00640020 \u2020.r.c.h. .a.n.d. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000060: 00440065 00760065 006c006f 0070006d \u2020.D.e.v.e.l.o.p.m <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000070: 0065006e 007400\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.e.n.t.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 6, Offset 0x27a, Length 69, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 69 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A27A<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 07000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 0002002b 00450050 0072006f 00640075 \u2020&#8230;+.E.P.r.o.d.u <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00630074 0069006f 006e004d 0061006e \u2020.c.t.i.o.n.M.a.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00750066 00610063 00740075 00720069 \u2020.u.f.a.c.t.u.r.i <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 006e0067 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.n.g.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 7, Offset 0x2bf, Length 85, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 85 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A2BF<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 08000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 0002003b 00550050 0072006f 00640075 \u2020&#8230;;.U.P.r.o.d.u <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00630074 0069006f 006e0020 0043006f \u2020.c.t.i.o.n. .C.o <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 006e0074 0072006f 006c004d 0061006e \u2020.n.t.r.o.l.M.a.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 00750066 00610063 00740075 00720069 \u2020.u.f.a.c.t.u.r.i <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 006e0067 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.n.g.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 8, Offset 0x314, Length 125, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 125 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A314<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 09000000 00001e92 00000400 \u20200&#8230; &#8230;&#8230;\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020035 007d0048 0075006d 0061006e \u2020&#8230;5.}.H.u.m.a.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00200052 00650073 006f0075 00720063 \u2020. .R.e.s.o.u.r.c <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00650073 00450078 00650063 00750074 \u2020.e.s.E.x.e.c.u.t <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 00690076 00650020 00470065 006e0065 \u2020.i.v.e. .G.e.n.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00720061 006c0020 0061006e 00640020 \u2020.r.a.l. .a.n.d. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000060: 00410064 006d0069 006e0069 00730074 \u2020.A.d.m.i.n.i.s.t <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000070: 00720061 00740069 006f006e 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.r.a.t.i.o.n.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 9, Offset 0x391, Length 109, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 109 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A391<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 0a000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020025 006d0046 0069006e 0061006e \u2020&#8230;%.m.F.i.n.a.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00630065 00450078 00650063 00750074 \u2020.c.e.E.x.e.c.u.t <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00690076 00650020 00470065 006e0065 \u2020.i.v.e. .G.e.n.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 00720061 006c0020 0061006e 00640020 \u2020.r.a.l. .a.n.d. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00410064 006d0069 006e0069 00730074 \u2020.A.d.m.i.n.i.s.t <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000060: 00720061 00740069 006f006e 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.r.a.t.i.o.n.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 10, Offset 0x3fe, Length 135, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 135 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A3FE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 0b000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 0002003f 00870049 006e0066 006f0072 \u2020&#8230;?.\u0087.I.n.f.o.r <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 006d0061 00740069 006f006e 00200053 \u2020.m.a.t.i.o.n. .S <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00650072 00760069 00630065 00730045 \u2020.e.r.v.i.c.e.s.E <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 00780065 00630075 00740069 00760065 \u2020.x.e.c.u.t.i.v.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00200047 0065006e 00650072 0061006c \u2020. .G.e.n.e.r.a.l <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000060: 00200061 006e0064 00200041 0064006d \u2020. .a.n.d. .A.d.m <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000070: 0069006e 00690073 00740072 00610074 \u2020.i.n.i.s.t.r.a.t <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000080: 0069006f 006e00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.i.o.n.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 11, Offset 0x485, Length 89, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 89 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A485<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 0c000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020037 00590044 006f0063 0075006d \u2020&#8230;7.Y.D.o.c.u.m <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 0065006e 00740020 0043006f 006e0074 \u2020.e.n.t. .C.o.n.t <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 0072006f 006c0051 00750061 006c0069 \u2020.r.o.l.Q.u.a.l.i <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 00740079 00200041 00730073 00750072 \u2020.t.y. .A.s.s.u.r <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 0061006e 00630065 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.a.n.c.e.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 12, Offset 0x4de, Length 91, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 91 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A4DE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 0d000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020039 005b0051 00750061 006c0069 \u2020&#8230;9.[.Q.u.a.l.i <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00740079 00200041 00730073 00750072 \u2020.t.y. .A.s.s.u.r <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 0061006e 00630065 00510075 0061006c \u2020.a.n.c.e.Q.u.a.l <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 00690074 00790020 00410073 00730075 \u2020.i.t.y. .A.s.s.u <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00720061 006e0063 006500\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.r.a.n.c.e.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 13, Offset 0x539, Length 147, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 147 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A539<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 0e000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 0002004b 00930046 00610063 0069006c \u2020&#8230;K.\u0093.F.a.c.i.l <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00690074 00690065 00730020 0061006e \u2020.i.t.i.e.s. .a.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00640020 004d0061 0069006e 00740065 \u2020.d. .M.a.i.n.t.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 006e0061 006e0063 00650045 00780065 \u2020.n.a.n.c.e.E.x.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00630075 00740069 00760065 00200047 \u2020.c.u.t.i.v.e. .G <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000060: 0065006e 00650072 0061006c 00200061 \u2020.e.n.e.r.a.l. .a <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000070: 006e0064 00200041 0064006d 0069006e \u2020.n.d. .A.d.m.i.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000080: 00690073 00740072 00610074 0069006f \u2020.i.s.t.r.a.t.i.o <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000090: 006e00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.n.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 14, Offset 0x5cc, Length 107, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 107 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A5CC<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 0f000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020043 006b0053 00680069 00700070 \u2020&#8230;C.k.S.h.i.p.p <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 0069006e 00670020 0061006e 00640020 \u2020.i.n.g. .a.n.d. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00520065 00630065 00690076 0069006e \u2020.R.e.c.e.i.v.i.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 00670049 006e0076 0065006e 0074006f \u2020.g.I.n.v.e.n.t.o <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00720079 0020004d 0061006e 00610067 \u2020.r.y. .M.a.n.a.g <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000060: 0065006d 0065006e 007400\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.e.m.e.n.t.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Slot 15, Offset 0x637, Length 113, DumpStyle BYTE<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS<\/span><br \/>\n<span style=\"font-size: xx-small;\">Record Size = 113 <\/span><br \/>\n<span style=\"font-size: xx-small;\">Memory Dump @0x000000000CE3A637<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">0000000000000000: 30000e00 10000000 00001e92 00000400 \u20200&#8230;&#8230;&#8230;.\u0092&#8230;. <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000010: 00020029 00710045 00780065 00630075 \u2020&#8230;).q.E.x.e.c.u <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000020: 00740069 00760065 00450078 00650063 \u2020.t.i.v.e.E.x.e.c <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000030: 00750074 00690076 00650020 00470065 \u2020.u.t.i.v.e. .G.e <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000040: 006e0065 00720061 006c0020 0061006e \u2020.n.e.r.a.l. .a.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000050: 00640020 00410064 006d0069 006e0069 \u2020.d. .A.d.m.i.n.i <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000060: 00730074 00720061 00740069 006f006e \u2020.s.t.r.a.t.i.o.n <\/span><br \/>\n<span style=\"font-size: xx-small;\">0000000000000070: 00\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020\u2020.<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">OFFSET TABLE:<\/span><\/p>\n<p><span style=\"font-size: xx-small;\">Row &#8211; Offset <\/span><br \/>\n<span style=\"font-size: xx-small;\">15 (0xf) &#8211; 1591 (0x637) <\/span><br \/>\n<span style=\"font-size: xx-small;\">14 (0xe) &#8211; 1484 (0x5cc) <\/span><br \/>\n<span style=\"font-size: xx-small;\">13 (0xd) &#8211; 1337 (0x539) <\/span><br \/>\n<span style=\"font-size: xx-small;\">12 (0xc) &#8211; 1246 (0x4de) <\/span><br \/>\n<span style=\"font-size: xx-small;\">11 (0xb) &#8211; 1157 (0x485) <\/span><br \/>\n<span style=\"font-size: xx-small;\">10 (0xa) &#8211; 1022 (0x3fe) <\/span><br \/>\n<span style=\"font-size: xx-small;\">9 (0x9) &#8211; 913 (0x391) <\/span><br \/>\n<span style=\"font-size: xx-small;\">8 (0x8) &#8211; 788 (0x314) <\/span><br \/>\n<span style=\"font-size: xx-small;\">7 (0x7) &#8211; 703 (0x2bf) <\/span><br \/>\n<span style=\"font-size: xx-small;\">6 (0x6) &#8211; 634 (0x27a) <\/span><br \/>\n<span style=\"font-size: xx-small;\">5 (0x5) &#8211; 515 (0x203) <\/span><br \/>\n<span style=\"font-size: xx-small;\">4 (0x4) &#8211; 432 (0x1b0) <\/span><br \/>\n<span style=\"font-size: xx-small;\">3 (0x3) &#8211; 353 (0x161) <\/span><br \/>\n<span style=\"font-size: xx-small;\">2 (0x2) &#8211; 282 (0x11a) <\/span><br \/>\n<span style=\"font-size: xx-small;\">1 (0x1) &#8211; 189 (0xbd) <\/span><br \/>\n<span style=\"font-size: xx-small;\">0 (0x0) &#8211; 96 (0x60)<\/span><br \/>\n<span style=\"font-size: xx-small;\">DBCC execution completed. If DBCC printed error messages, contact your system administrator.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Nous retrouvons bien ici tous nos enregistrements, comme attendu.<\/p>\n<p>Il est important de bien noter que la page indiqu\u00e9e correspond \u00e0 l&rsquo;index qui a \u00e9t\u00e9 utilis\u00e9 pour retourner les enregistrements. Il faut donc bien veiller par exemple \u00e0 ne pas pas esp\u00e9rer retrouver la page de l&rsquo;index clustered si la requ\u00eate n&rsquo;utilise qu&rsquo;un index non clustered. En effet, chaque index utilise ses propres pages.<\/p>\n<p>Par exemple :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">select\r\n\td.DepartmentID,\r\n\td.GroupName,\r\n\tsys.fn_PhysLocFormatter(%%physloc%%) as [Emplacement]\r\nfrom HumanResources.Department d with (index(PK_Department_DepartmentID))\r\norder by d.DepartmentID\r\n\r\nselect\r\n\td.DepartmentID,\r\n\td.GroupName,\r\n\tsys.fn_PhysLocFormatter(%%physloc%%) as [Emplacement]\r\nfrom HumanResources.Department d with (index(AK_Department_Name))\r\norder by d.DepartmentID<\/pre>\n<p>Nous constatons que les pages ne sont pas identiques suivant l&rsquo;index utilis\u00e9.<\/p>\n<p><a href=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Page_Index.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-497\" title=\"Page_Index\" src=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Page_Index.png\" alt=\"\" width=\"555\" height=\"589\" srcset=\"https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Page_Index.png 555w, https:\/\/www.sqlserver.fr\/blog\/wp-content\/uploads\/2012\/06\/Page_Index-282x300.png 282w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/a><\/p>\n<p>Voil\u00e0 donc pour une petite pr\u00e9sentation de la colonne cach\u00e9e %%physlock%%, qui permet de localiser pr\u00e9cis\u00e9ment\u00a0o\u00f9 les donn\u00e9es sont rang\u00e9es. \u00a0Et le stockage des donn\u00e9es \u00e9tant au coeur de tout moteur, il est toujours int\u00e9ressant d&rsquo;avoir le maximum d&rsquo;informations \u00e0 son sujet&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Voici un petit article pr\u00e9sentant une fonction non document\u00e9e qui permet de localiser l&rsquo;endroit o\u00f9 est stock\u00e9e une ligne donn\u00e9e. Cela peut notamment permettre de situer les autres lignes pr\u00e9sentes dans la m\u00eame page, et qui pourraient subir les effets &hellip; <a href=\"https:\/\/www.sqlserver.fr\/blog\/ou-est-mon-enregistrement\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-483","post","type-post","status-publish","format-standard","hentry","category-article_sql"],"_links":{"self":[{"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/posts\/483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/comments?post=483"}],"version-history":[{"count":20,"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/posts\/483\/revisions"}],"predecessor-version":[{"id":1953,"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/posts\/483\/revisions\/1953"}],"wp:attachment":[{"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/media?parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/categories?post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlserver.fr\/blog\/wp-json\/wp\/v2\/tags?post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}