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
Troubleshooting PostgreSQL

You're reading from   Troubleshooting PostgreSQL Intercept problems and challenges typically faced by PostgreSQL database administrators with the best troubleshooting techniques

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher Packt
ISBN-13 9781783555314
Length 164 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Installing PostgreSQL FREE CHAPTER 2. Creating Data Structures 3. Handling Indexes 4. Reading Data Efficiently and Correctly 5. Getting Transactions and Locking Right 6. Writing Proper Procedures 7. PostgreSQL Monitoring 8. Fixing Backups and Replication 9. Handling Hardware and Software Disasters 10. A Standard Approach to Troubleshooting Index

Reading large amounts of data

Some applications require large amounts of data that have to be read by the database. Usually, two major cases can be distinguished:

  • Reading large amounts of data and shipping them to the client
  • Reading large amounts of data so that the server can process them

In this section, both the cases will be covered because they have slightly different requirements.

Making use of cursors

Cursors are a fundamental concept provided by all reasonable relational databases. However, cursors are often ignored and not used the way they should be, which leads to problems all along the way.

Why would anybody want to use a cursor, and what is it all about anyway? Consider the following example:

SELECT * FROM very_large_table;

For PostgreSQL, this is no problem at all. It will calculate the result and send it to the client server. However, the client may instantly crash because it will try to store all of the data in the memory. If the table is really large, the client may just not...

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