зеркало из
				https://github.com/iharh/notes.git
				synced 2025-10-30 21:26:09 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			40 строки
		
	
	
		
			844 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			40 строки
		
	
	
		
			844 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| https://www.postgresql.org/docs/current/storage.html
 | |
| https://www.postgresql.org/docs/current/storage-page-layout.html
 | |
| https://postgrespro.ru/docs/postgrespro/current/storage-page-layout
 | |
| 
 | |
| each table consists from multiple layers
 | |
| each file is no more than 1 Gb
 | |
| 
 | |
| object layers
 | |
| ?init?
 | |
|     zagotovka of main
 | |
|     used only while "sboy"
 | |
| main
 | |
|     NNN.2
 | |
|     NNN.1
 | |
|     NNN
 | |
| fsm (free space mem)
 | |
|     NNN_fsm
 | |
|     NNN_fsm.1
 | |
| vm (visibility map, needed for vacuum optimization)
 | |
|     NNN_vm
 | |
| 
 | |
| Each file is a set of pages
 | |
| page
 | |
|     header
 | |
|     [some free space]
 | |
|     data
 | |
| 
 | |
| Buffer cache (caches some pages)
 | |
| 
 | |
| note
 | |
|     on index-only scan we can't just use index (need xmin, xmax)
 | |
|     visibility map allow us to overcome this limitation  
 | |
| 
 | |
| # cmd-line util
 | |
| $ oid2name 
 | |
| 
 | |
| pg_total_relation_size(<tblname>)
 | |
| pg_relation_size(<tblname>, <layername>)
 | |
| pg_indexes_size(<tblname>)
 | 
