SlideShare a Scribd company logo
PostgreSQL
worst practices
Ilya Kosmodemiansky
ik@dataegret.com
Best practices are just boring
• Never follow them, try worst practices
• Only worst practices can really help you screw things up in a
most effective way
• PostgreSQL consultants are nice people - keep them happy!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
How it works?
• I have a list, a little bit more than 100 worst practices
• I do not make this stuff up, all of them are real-life examples
• I reshuffle my list every time before presenting and pick a few
examples
• Well, there are some things, which I like more or less, so it is
not a very honest shuffle
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
0. Do not use indexes (a test one!)
• Basically, there is no difference between full table scan and
index scan
• You can check that. Just insert 10 rows into a test table on
your test server and compare.
• Nobody deals with more than 10 row tables in production!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
1. Use as many count(*) as you can
• Figure 301083021830123921 is very informative for the end
user
• If it changes in a second to 30108302894839434020, it is still
informative
• select count(*) from sometable is a quite light-weighted query
• Tuple estimation from pg_catalog can never be precise
enough to you
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
2. Use ORM
• All databases share the same syntax
• You must write database-independent code
• Are there any benefits, which are based on database specific
features?
• It always good to learn a new complicated technology
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
3. Move joins to your application
• Just select * a couple of tables into the application written in
your favorite programming language
• Than join them at the application level
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
3. Move joins to your application
• Just select * a couple of tables into the application written in
your favorite programming language
• Than join them at the application level
• Now you only need to implement nested loop join, hash join
and merge join as well as query optimizer and page cache
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
4. Be in trend, be schema-less
• You do not need to design the schema
• You only need one table, two columns: id bigserial and extra
jsonb
• JSONB datatype is pretty effective in PostgreSQL, you can
query it just like a well-structured table
• Even if you put a 100M of JSON in it
• Even if you have 1000+ tps
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
5. Be agile, use EAV
• You only need 3 tables: entity, attribute, value
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
5. Be agile, use EAV
• You only need 3 tables: entity, attribute, value
• At some point add the 4th: attribute_type
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
5. Be agile, use EAV
• You only need 3 tables: entity, attribute, value
• At some point add the 4th: attribute_type
• When it starts slowing down, just call those four tables The
Core and add 1000+ tables with denormalized data
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
5. Be agile, use EAV
• You only need 3 tables: entity, attribute, value
• At some point add the 4th: attribute_type
• When it starts slowing down, just call those four tables The
Core and add 1000+ tables with denormalized data
• If it is not enough, you can always add value_version
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
6. Try to create as many indexes as you can
• Indexes consume no disk space
• Indexes consume no shared_bufers
• There is no overhead on DML if one and every column in a
table covered with bunch of indexes
• Optimizer will definitely choose your index once you created it
• Keep calm and create more indexes
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
7. Always keep all your time series data
• Time series data like tables with logs or session history should
never be deleted, aggregated or archived, you always need to
keep it all
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
7. Always keep all your time series data
• Time series data like tables with logs or session history should
never be deleted, aggregated or archived, you always need to
keep it all
• You will always know where to check, if you run out of disk
space
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
7. Always keep all your time series data
• Time series data like tables with logs or session history should
never be deleted, aggregated or archived, you always need to
keep it all
• You will always know where to check, if you run out of disk
space
• You can always call that Big Data
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
7. Always keep all your time series data
• Time series data like tables with logs or session history should
never be deleted, aggregated or archived, you always need to
keep it all
• You will always know where to check, if you run out of disk
space
• You can always call that Big Data
• Solve the problem using partitioning... one partition for an
hour or for a minute
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
8. Turn autovacuum off
• It is quite auxiliary process, you can easily stop it
• There is no problem at all to have 100Gb data in a database
which is 1Tb in size
• 2-3Tb RAM servers are cheap, IO is a fastest thing in modern
computing
• Besides, everyone likes BigData
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
9. Reinvent Slony
• If you need some data replication to another database, try to
implement it from scratch
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
9. Reinvent Slony
• If you need some data replication to another database, try to
implement it from scratch
• That allows you to run into all sorts of problems PostgreSQL
had since introducing Slony
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
10. Keep master and slave on different hardware
• That will maximize the possibility of unsuccessful failover
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
10. Keep master and slave on different hardware
• That will maximize the possibility of unsuccessful failover
• To make things even worse, you can change only slave-related
parameters at slave, leaving defaults for shared_buffers etc.
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
11. Put a synchronous replica to remote DC
• Indeed! That will maximize availability!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
11. Put a synchronous replica to remote DC
• Indeed! That will maximize availability!
• Especially, if you put the replica to another continent
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
12. Never use Foreign Keys
• Consistency control at application level always works as
expected
• You will never get data inconsistency without constraints
• Even if you already have a bullet proof framework to maintain
consistency, could it be good enough reason to use it?
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
13. Always use text type for all columns
• It is always fun to reimplement date or ip validation in your
code
• You will never mistakenly convert ”12-31-2015 03:01AM” to
”15:01 12 of undef 2015” using text fields
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
14. Always use improved ”PostgreSQL”
• Postgres is not a perfect database and you are smart
• All that annoying MVCC staff, 32 bit xid and autovacuum
nightmares look the way they do because hackers are oldschool
and lazy
• Hack it in a hard way, do not bother submitting your patch to
the community, just put it into production
• It is easy to maintain such production and keep it compatible
with ”not perfect” PostgreSQL upcoming versions
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
15. Postgres likes long transactions
• Always call external services from stored procedures (like
sending emails)
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
15. Postgres likes long transactions
• Always call external services from stored procedures (like
sending emails)
• Oh, it is arguable... It can be, if 100% of developers were
familiar with word timeout
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
15. Postgres likes long transactions
• Always call external services from stored procedures (like
sending emails)
• Oh, it is arguable... It can be, if 100% of developers were
familiar with word timeout
• Anyway, you can just start transaction and go away for a
weekend
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
16. Never read your code, write it!
genre_id IN
( SELECT id FROM genres WHERE genres.id IN
(SELECT * FROM unnest(array[155]))
)
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
17. Have problems with you PostgreSQL installation?
• Move those problems to the container!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
17. Have problems with you PostgreSQL installation?
• Move those problems to the container!
• It is always good to have something very stable inside
something very unstable!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
17. Have problems with you PostgreSQL installation?
• Move those problems to the container!
• It is always good to have something very stable inside
something very unstable!
• Now your problems are both inside and outside!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
17. Not only Slony should be reinvented!
• Need to convert timestamp? Stored procedure in C will help!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
17. Not only Slony should be reinvented!
• Need to convert timestamp? Stored procedure in C will help!
• Need a message queue? Write it!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
17. Not only Slony should be reinvented!
• Need to convert timestamp? Stored procedure in C will help!
• Need a message queue? Write it!
• Won’t use ORM? Write your own in plpgsql
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
18. And never, never use exceptions
• Documentation says they are slow
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
18. And never, never use exceptions
• Documentation says they are slow
• Raise notice on errors - everyone reads logs constantly!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
18. And never, never use exceptions
• Documentation says they are slow
• Raise notice on errors - everyone reads logs constantly!
• Who cares about errors?
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
19. Application runs out of connections?
• Set max_connections to 1000
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
19. Application runs out of connections?
• Set max_connections to 1000
• Common, servers with 1000 CPUs are cheap now
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
19. Application runs out of connections?
• Set max_connections to 1000
• Common, servers with 1000 CPUs are cheap now
• Who said PostgreSQL workers have some overhead?
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
19. Application runs out of connections?
• Set max_connections to 1000
• Common, servers with 1000 CPUs are cheap now
• Who said PostgreSQL workers have some overhead?
• And never ever use pgbouncer!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
20. Use pgpool-II instead
• Pooling connections with pgpool is easy...
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
20. Use pgpool-II instead
• Pooling connections with pgpool is easy...
• Just like writing a code in that Emacs OS...
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
20. Use pgpool-II instead
• Pooling connections with pgpool is easy...
• Just like writing a code in that Emacs OS...
• Simple config, useful features
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
20. Use pgpool-II instead
• Pooling connections with pgpool is easy...
• Just like writing a code in that Emacs OS...
• Simple config, useful features
• Consulters are happy!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
21. Always start tuning PostgreSQL...
• From optimizer options in postgresql.conf
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
21. Always start tuning PostgreSQL...
• From optimizer options in postgresql.conf
• Forget about those shared_buffers and checkpoints!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
21. Always start tuning PostgreSQL...
• From optimizer options in postgresql.conf
• Forget about those shared_buffers and checkpoints!
• geqo options are a good candidate to be a silver bullet!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
22. Have heard about a cool new feature?
• Use it in production immediately!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
22. Have heard about a cool new feature?
• Use it in production immediately!
• Attend MVCC Unmasked by Bruce Momjian (Today, 15:50,
Liberty I)
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
22. Have heard about a cool new feature?
• Use it in production immediately!
• Attend MVCC Unmasked by Bruce Momjian (Today, 15:50,
Liberty I)
• Learn about xmin and xmax
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
22. Have heard about a cool new feature?
• Use it in production immediately!
• Attend MVCC Unmasked by Bruce Momjian (Today, 15:50,
Liberty I)
• Learn about xmin and xmax
• Use it in your applications logic!
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
Do not forget
That was WORST practices talk
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
Send me your favourite!
ik@dataegret.com
dataegret.com
Why this talk
• Linux is a most common OS for databases
• DBAs often run into IO problems
• Most of the information on topic is written by kerneldevelopers
(for kernel developers) or is checklist-style
• Checklists are useful, but up to certain workload
dataegret.com
Ad

More Related Content

What's hot (20)

YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions
Yugabyte
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problems
Alexander Korotkov
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performance
MariaDB plc
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
NTT DATA OSS Professional Services
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
Jean-François Gagné
 
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
DataStax
 
PostgreSQL Replication Tutorial
PostgreSQL Replication TutorialPostgreSQL Replication Tutorial
PostgreSQL Replication Tutorial
Hans-Jürgen Schönig
 
Active Session History in PostgreSQL:
Active Session History in PostgreSQL:Active Session History in PostgreSQL:
Active Session History in PostgreSQL:
BertrandDrouvot
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
Frederic Descamps
 
1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례
I Goo Lee
 
Tuning Autovacuum in Postgresql
Tuning Autovacuum in PostgresqlTuning Autovacuum in Postgresql
Tuning Autovacuum in Postgresql
Mydbops
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PgDay.Seoul
 
Scaling for Performance
Scaling for PerformanceScaling for Performance
Scaling for Performance
ScyllaDB
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detail
MIJIN AN
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guide
Ryan Blue
 
PostgreSQL and Benchmarks
PostgreSQL and BenchmarksPostgreSQL and Benchmarks
PostgreSQL and Benchmarks
Jignesh Shah
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
I Goo Lee
 
Query Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Query Optimization with MySQL 8.0 and MariaDB 10.3: The BasicsQuery Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Query Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Jaime Crespo
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
PgDay.Seoul
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
Alexey Bashtanov
 
YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions
Yugabyte
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problems
Alexander Korotkov
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performance
MariaDB plc
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
Jean-François Gagné
 
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
DataStax
 
Active Session History in PostgreSQL:
Active Session History in PostgreSQL:Active Session History in PostgreSQL:
Active Session History in PostgreSQL:
BertrandDrouvot
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
Frederic Descamps
 
1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례
I Goo Lee
 
Tuning Autovacuum in Postgresql
Tuning Autovacuum in PostgresqlTuning Autovacuum in Postgresql
Tuning Autovacuum in Postgresql
Mydbops
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PgDay.Seoul
 
Scaling for Performance
Scaling for PerformanceScaling for Performance
Scaling for Performance
ScyllaDB
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detail
MIJIN AN
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guide
Ryan Blue
 
PostgreSQL and Benchmarks
PostgreSQL and BenchmarksPostgreSQL and Benchmarks
PostgreSQL and Benchmarks
Jignesh Shah
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
I Goo Lee
 
Query Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Query Optimization with MySQL 8.0 and MariaDB 10.3: The BasicsQuery Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Query Optimization with MySQL 8.0 and MariaDB 10.3: The Basics
Jaime Crespo
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
PgDay.Seoul
 

Similar to PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky (20)

Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
PostgreSQL-Consulting
 
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL-Consulting
 
The 5 Minute MySQL DBA
The 5 Minute MySQL DBAThe 5 Minute MySQL DBA
The 5 Minute MySQL DBA
Irawan Soetomo
 
Neo4j Training Cypher
Neo4j Training CypherNeo4j Training Cypher
Neo4j Training Cypher
Max De Marzi
 
Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...
Danny Mulligan
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
elliando dias
 
Yapc10 Cdt World Domination
Yapc10   Cdt World DominationYapc10   Cdt World Domination
Yapc10 Cdt World Domination
cPanel
 
Unbreaking Your Django Application
Unbreaking Your Django ApplicationUnbreaking Your Django Application
Unbreaking Your Django Application
OSCON Byrum
 
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
BIWUG
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
PGConf APAC
 
Running MySQL on Linux
Running MySQL on LinuxRunning MySQL on Linux
Running MySQL on Linux
Great Wide Open
 
How to Build a Compute Cluster
How to Build a Compute ClusterHow to Build a Compute Cluster
How to Build a Compute Cluster
Ramsay Key
 
MySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewMySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of view
Sachin Khosla
 
Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)
Oren Eini
 
Scaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHPScaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHP
120bi
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
Achievers Tech
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Ofer Zelig
 
Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016
PostgreSQL-Consulting
 
Technical track-afterimaging Progress Database
Technical track-afterimaging Progress DatabaseTechnical track-afterimaging Progress Database
Technical track-afterimaging Progress Database
Vinh Nguyen
 
Redis: An introduction
Redis: An introductionRedis: An introduction
Redis: An introduction
Đặng Thảo
 
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
PostgreSQL-Consulting
 
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL-Consulting
 
The 5 Minute MySQL DBA
The 5 Minute MySQL DBAThe 5 Minute MySQL DBA
The 5 Minute MySQL DBA
Irawan Soetomo
 
Neo4j Training Cypher
Neo4j Training CypherNeo4j Training Cypher
Neo4j Training Cypher
Max De Marzi
 
Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...
Danny Mulligan
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
elliando dias
 
Yapc10 Cdt World Domination
Yapc10   Cdt World DominationYapc10   Cdt World Domination
Yapc10 Cdt World Domination
cPanel
 
Unbreaking Your Django Application
Unbreaking Your Django ApplicationUnbreaking Your Django Application
Unbreaking Your Django Application
OSCON Byrum
 
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
BIWUG
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
PGConf APAC
 
How to Build a Compute Cluster
How to Build a Compute ClusterHow to Build a Compute Cluster
How to Build a Compute Cluster
Ramsay Key
 
MySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewMySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of view
Sachin Khosla
 
Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)
Oren Eini
 
Scaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHPScaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHP
120bi
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
Achievers Tech
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Ofer Zelig
 
Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016
PostgreSQL-Consulting
 
Technical track-afterimaging Progress Database
Technical track-afterimaging Progress DatabaseTechnical track-afterimaging Progress Database
Technical track-afterimaging Progress Database
Vinh Nguyen
 
Redis: An introduction
Redis: An introductionRedis: An introduction
Redis: An introduction
Đặng Thảo
 
Ad

More from PostgreSQL-Consulting (11)

Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
PostgreSQL-Consulting
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
PostgreSQL-Consulting
 
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 ViennaAutovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
PostgreSQL-Consulting
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
PostgreSQL-Consulting
 
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQPostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL-Consulting
 
Как PostgreSQL работает с диском
Как PostgreSQL работает с дискомКак PostgreSQL работает с диском
Как PostgreSQL работает с диском
PostgreSQL-Consulting
 
Максим Богук. Postgres-XC
Максим Богук. Postgres-XCМаксим Богук. Postgres-XC
Максим Богук. Postgres-XC
PostgreSQL-Consulting
 
Иван Фролков. Tricky SQL
Иван Фролков. Tricky SQLИван Фролков. Tricky SQL
Иван Фролков. Tricky SQL
PostgreSQL-Consulting
 
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQLИлья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
PostgreSQL-Consulting
 
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
PostgreSQL-Consulting
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
PostgreSQL-Consulting
 
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 ViennaAutovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
PostgreSQL-Consulting
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
PostgreSQL-Consulting
 
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQPostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL-Consulting
 
Как PostgreSQL работает с диском
Как PostgreSQL работает с дискомКак PostgreSQL работает с диском
Как PostgreSQL работает с диском
PostgreSQL-Consulting
 
Максим Богук. Postgres-XC
Максим Богук. Postgres-XCМаксим Богук. Postgres-XC
Максим Богук. Postgres-XC
PostgreSQL-Consulting
 
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQLИлья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
PostgreSQL-Consulting
 
Ad

Recently uploaded (20)

DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Compiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptxCompiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptx
RushaliDeshmukh2
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Compiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptxCompiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptx
RushaliDeshmukh2
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 

PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky

  • 2. Best practices are just boring • Never follow them, try worst practices • Only worst practices can really help you screw things up in a most effective way • PostgreSQL consultants are nice people - keep them happy! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 3. How it works? • I have a list, a little bit more than 100 worst practices • I do not make this stuff up, all of them are real-life examples • I reshuffle my list every time before presenting and pick a few examples • Well, there are some things, which I like more or less, so it is not a very honest shuffle dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 4. 0. Do not use indexes (a test one!) • Basically, there is no difference between full table scan and index scan • You can check that. Just insert 10 rows into a test table on your test server and compare. • Nobody deals with more than 10 row tables in production! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 5. 1. Use as many count(*) as you can • Figure 301083021830123921 is very informative for the end user • If it changes in a second to 30108302894839434020, it is still informative • select count(*) from sometable is a quite light-weighted query • Tuple estimation from pg_catalog can never be precise enough to you dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 6. 2. Use ORM • All databases share the same syntax • You must write database-independent code • Are there any benefits, which are based on database specific features? • It always good to learn a new complicated technology dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 7. 3. Move joins to your application • Just select * a couple of tables into the application written in your favorite programming language • Than join them at the application level dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 8. 3. Move joins to your application • Just select * a couple of tables into the application written in your favorite programming language • Than join them at the application level • Now you only need to implement nested loop join, hash join and merge join as well as query optimizer and page cache dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 9. 4. Be in trend, be schema-less • You do not need to design the schema • You only need one table, two columns: id bigserial and extra jsonb • JSONB datatype is pretty effective in PostgreSQL, you can query it just like a well-structured table • Even if you put a 100M of JSON in it • Even if you have 1000+ tps dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 10. 5. Be agile, use EAV • You only need 3 tables: entity, attribute, value dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 11. 5. Be agile, use EAV • You only need 3 tables: entity, attribute, value • At some point add the 4th: attribute_type dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 12. 5. Be agile, use EAV • You only need 3 tables: entity, attribute, value • At some point add the 4th: attribute_type • When it starts slowing down, just call those four tables The Core and add 1000+ tables with denormalized data dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 13. 5. Be agile, use EAV • You only need 3 tables: entity, attribute, value • At some point add the 4th: attribute_type • When it starts slowing down, just call those four tables The Core and add 1000+ tables with denormalized data • If it is not enough, you can always add value_version dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 14. 6. Try to create as many indexes as you can • Indexes consume no disk space • Indexes consume no shared_bufers • There is no overhead on DML if one and every column in a table covered with bunch of indexes • Optimizer will definitely choose your index once you created it • Keep calm and create more indexes dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 15. 7. Always keep all your time series data • Time series data like tables with logs or session history should never be deleted, aggregated or archived, you always need to keep it all dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 16. 7. Always keep all your time series data • Time series data like tables with logs or session history should never be deleted, aggregated or archived, you always need to keep it all • You will always know where to check, if you run out of disk space dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 17. 7. Always keep all your time series data • Time series data like tables with logs or session history should never be deleted, aggregated or archived, you always need to keep it all • You will always know where to check, if you run out of disk space • You can always call that Big Data dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 18. 7. Always keep all your time series data • Time series data like tables with logs or session history should never be deleted, aggregated or archived, you always need to keep it all • You will always know where to check, if you run out of disk space • You can always call that Big Data • Solve the problem using partitioning... one partition for an hour or for a minute dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 19. 8. Turn autovacuum off • It is quite auxiliary process, you can easily stop it • There is no problem at all to have 100Gb data in a database which is 1Tb in size • 2-3Tb RAM servers are cheap, IO is a fastest thing in modern computing • Besides, everyone likes BigData dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 20. 9. Reinvent Slony • If you need some data replication to another database, try to implement it from scratch dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 21. 9. Reinvent Slony • If you need some data replication to another database, try to implement it from scratch • That allows you to run into all sorts of problems PostgreSQL had since introducing Slony dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 22. 10. Keep master and slave on different hardware • That will maximize the possibility of unsuccessful failover dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 23. 10. Keep master and slave on different hardware • That will maximize the possibility of unsuccessful failover • To make things even worse, you can change only slave-related parameters at slave, leaving defaults for shared_buffers etc. dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 24. 11. Put a synchronous replica to remote DC • Indeed! That will maximize availability! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 25. 11. Put a synchronous replica to remote DC • Indeed! That will maximize availability! • Especially, if you put the replica to another continent dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 26. 12. Never use Foreign Keys • Consistency control at application level always works as expected • You will never get data inconsistency without constraints • Even if you already have a bullet proof framework to maintain consistency, could it be good enough reason to use it? dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 27. 13. Always use text type for all columns • It is always fun to reimplement date or ip validation in your code • You will never mistakenly convert ”12-31-2015 03:01AM” to ”15:01 12 of undef 2015” using text fields dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 28. 14. Always use improved ”PostgreSQL” • Postgres is not a perfect database and you are smart • All that annoying MVCC staff, 32 bit xid and autovacuum nightmares look the way they do because hackers are oldschool and lazy • Hack it in a hard way, do not bother submitting your patch to the community, just put it into production • It is easy to maintain such production and keep it compatible with ”not perfect” PostgreSQL upcoming versions dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 29. 15. Postgres likes long transactions • Always call external services from stored procedures (like sending emails) dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 30. 15. Postgres likes long transactions • Always call external services from stored procedures (like sending emails) • Oh, it is arguable... It can be, if 100% of developers were familiar with word timeout dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 31. 15. Postgres likes long transactions • Always call external services from stored procedures (like sending emails) • Oh, it is arguable... It can be, if 100% of developers were familiar with word timeout • Anyway, you can just start transaction and go away for a weekend dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 32. 16. Never read your code, write it! genre_id IN ( SELECT id FROM genres WHERE genres.id IN (SELECT * FROM unnest(array[155])) ) dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 33. 17. Have problems with you PostgreSQL installation? • Move those problems to the container! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 34. 17. Have problems with you PostgreSQL installation? • Move those problems to the container! • It is always good to have something very stable inside something very unstable! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 35. 17. Have problems with you PostgreSQL installation? • Move those problems to the container! • It is always good to have something very stable inside something very unstable! • Now your problems are both inside and outside! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 36. 17. Not only Slony should be reinvented! • Need to convert timestamp? Stored procedure in C will help! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 37. 17. Not only Slony should be reinvented! • Need to convert timestamp? Stored procedure in C will help! • Need a message queue? Write it! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 38. 17. Not only Slony should be reinvented! • Need to convert timestamp? Stored procedure in C will help! • Need a message queue? Write it! • Won’t use ORM? Write your own in plpgsql dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 39. 18. And never, never use exceptions • Documentation says they are slow dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 40. 18. And never, never use exceptions • Documentation says they are slow • Raise notice on errors - everyone reads logs constantly! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 41. 18. And never, never use exceptions • Documentation says they are slow • Raise notice on errors - everyone reads logs constantly! • Who cares about errors? dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 42. 19. Application runs out of connections? • Set max_connections to 1000 dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 43. 19. Application runs out of connections? • Set max_connections to 1000 • Common, servers with 1000 CPUs are cheap now dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 44. 19. Application runs out of connections? • Set max_connections to 1000 • Common, servers with 1000 CPUs are cheap now • Who said PostgreSQL workers have some overhead? dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 45. 19. Application runs out of connections? • Set max_connections to 1000 • Common, servers with 1000 CPUs are cheap now • Who said PostgreSQL workers have some overhead? • And never ever use pgbouncer! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 46. 20. Use pgpool-II instead • Pooling connections with pgpool is easy... dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 47. 20. Use pgpool-II instead • Pooling connections with pgpool is easy... • Just like writing a code in that Emacs OS... dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 48. 20. Use pgpool-II instead • Pooling connections with pgpool is easy... • Just like writing a code in that Emacs OS... • Simple config, useful features dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 49. 20. Use pgpool-II instead • Pooling connections with pgpool is easy... • Just like writing a code in that Emacs OS... • Simple config, useful features • Consulters are happy! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 50. 21. Always start tuning PostgreSQL... • From optimizer options in postgresql.conf dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 51. 21. Always start tuning PostgreSQL... • From optimizer options in postgresql.conf • Forget about those shared_buffers and checkpoints! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 52. 21. Always start tuning PostgreSQL... • From optimizer options in postgresql.conf • Forget about those shared_buffers and checkpoints! • geqo options are a good candidate to be a silver bullet! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 53. 22. Have heard about a cool new feature? • Use it in production immediately! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 54. 22. Have heard about a cool new feature? • Use it in production immediately! • Attend MVCC Unmasked by Bruce Momjian (Today, 15:50, Liberty I) dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 55. 22. Have heard about a cool new feature? • Use it in production immediately! • Attend MVCC Unmasked by Bruce Momjian (Today, 15:50, Liberty I) • Learn about xmin and xmax dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 56. 22. Have heard about a cool new feature? • Use it in production immediately! • Attend MVCC Unmasked by Bruce Momjian (Today, 15:50, Liberty I) • Learn about xmin and xmax • Use it in your applications logic! dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 57. Do not forget That was WORST practices talk dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com
  • 58. Send me your favourite! [email protected] dataegret.com Why this talk • Linux is a most common OS for databases • DBAs often run into IO problems • Most of the information on topic is written by kerneldevelopers (for kernel developers) or is checklist-style • Checklists are useful, but up to certain workload dataegret.com