Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

How to think about

performance
Selena Deckelmann
PostgreSQL User Group Liaison
postgresql.org

End Point Corporation


Hubris
Case Study:
How we are teaching
people to think about
performance
PostgreSQL Portland
Performance Practice
Project
Monthly meetings to talk about
performance
Mark Wong

http://pugs.postgresql.org/blog/92
Meetings at Portland State University

Hardware donated by HP

Data center space from Command


Prompt, Inc.
Our data:

http://moourl.com/fsperf
What do we teach?
Bottlenecks
Baselining
Constraints
Bottlenecks
sar
mpstat
iostat
vmstat
readprofile
Baselining
• Application-specific.
• Filesystem performance.
• Start from defaults.
• Change one thing at a time.
• Use Science.
Constraints
• Hardware
• Operating system
• Time/Money
• Patience
We need your help.
• Go through our data.
• Pose new questions.
• Ask us about running tests.
How Postgres thinks
about performance
Synchronized Scan
“Do you need to start
at the beginning?”

• Have a sequential scan in progress?


• Piggy-back on that sequential scan.
• Version 8.3
HOT
“Don’t do something
you don’t have to.”
• Heap Only Tuples (HOT)
• Have an UPDATE to a table that doesn’t
affect an index?
• Don’t update the index.
• Version 8.3
Visibility Map
“Don’t do something
you don’t have to.”
• Free Space Map shows space in table files
that is available for reuse.
• Visibility Map is a bitmap that tells whether
or not a tuple is visible to all transaction
ids. If marked visible, don’t bother
VACUUMing.
• Reduces VACUUM cost (less I/O)
• Version 8.4 (beta out now!)
Thanks!
Postgres BoF 7:30pm
Camino Real
@selenamarie (identi.ca/twitter)
selena@postgresql.org

You might also like