How to think about performance

Selena Deckelmann PostgreSQL User Group Liaison End Point Corporation


Case Study: How we are teaching people to think about performance

PostgreSQL Portland Performance Practice Project
Monthly meetings to talk about performance

Mark Wong

Meetings at Portland State University Hardware donated by HP Data center space from Command Prompt, Inc.

Our data:

What do we teach?

Bottlenecks Baselining Constraints


sar mpstat iostat vmstat readprofile


• Application-specific. • Filesystem performance. • Start from defaults. • Change one thing at a time. • Use Science.


• 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


“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!)

@selenamarie (

Thanks! Postgres BoF 7:30pm Camino Real

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.