Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
PostgreSQL 16 Administration Cookbook

You're reading from  PostgreSQL 16 Administration Cookbook

Product type Book
Published in Dec 2023
Publisher Packt
ISBN-13 9781835460580
Pages 636 pages
Edition 1st Edition
Languages
Authors (5):
Gianni Ciolli Gianni Ciolli
Profile icon Gianni Ciolli
Boriss Mejías Boriss Mejías
Profile icon Boriss Mejías
Jimmy Angelakos Jimmy Angelakos
Profile icon Jimmy Angelakos
Vibhor Kumar Vibhor Kumar
Profile icon Vibhor Kumar
Simon Riggs Simon Riggs
Profile icon Simon Riggs
View More author details

Table of Contents (15) Chapters

Preface First Steps Exploring the Database Server Configuration Server Control Tables and Data Security Database Administration Monitoring and Diagnosis Regular Maintenance Performance and Concurrency Backup and Recovery Replication and Upgrades Other Books You May Enjoy
Index

Randomly sampling data

DBAs may be asked to set up a test server and populate it with test data. Often, that server will be old hardware, possibly with smaller disk sizes. So, the subject of data sampling raises its head.

The purpose of sampling is to reduce the size of the dataset and improve the speed of later analysis. Some statisticians are so used to the idea of sampling that they may not even question whether its use is valid or if it might cause further complications.

The SQL standard way to perform sampling is by adding the TABLESAMPLE clause to the SELECT statement.

How to do it…

In this section, we will take a random sample of a given collection of data (for example, a given table). First, you should realize that there isn’t a simple tool to slice off a sample of your database. It would be neat if there were, but there isn’t. You’ll need to read all of this to understand why:

  1. We first consider using SQL to derive a...
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 $15.99/month. Cancel anytime}