Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PostgreSQL Administration Essentials

You're reading from   PostgreSQL Administration Essentials Discover efficient ways to administer, monitor, replicate, and handle your PostgreSQL databases

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher Packt
ISBN-13 9781783988983
Length 142 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Configuring the checkpoints

Now that you have seen what xlog is good for, it is necessary to discuss the concept of checkpoints. Let's assume we are inserting data just like we did earlier:

INSERT INTO foo VALUES ('abcdefg');

As you might expect, the ultimate goal of this INSERT statement is to write the new data to a table. In PostgreSQL, a table is always represented by a couple of datafiles consisting of 8k blocks (unless changed at compile time). The core question now is: is it desirable to write to the table directly? As discussed earlier in this chapter, writing to the table directly is not feasible anyway because in case of a crash, things would go south. Therefore, we go to the transaction log first. But this is not the end of the story as the next diagram shows:

Configuring the checkpoints

Once the data has been sent to the transaction log, a copy of the future block on disk will be placed inside PostgreSQL shared buffers—data does not necessarily have to go to the table instantly; it...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime