Control flow of a query in PostgreSQL

January 27th, 2012

As of version 9.0.4
Read more…

Mr. One Database

Adjust Vim split window size

January 18th, 2012

1. Change the height (number of rows) of a split window
To increase by 10, type command

:res+10

Read more…

Mr. One Coding

A TPC-H Q21 query plan

November 27th, 2011

Configuration:
PostgreSQL 9.0.4. memsize/data size = 1/8
Read more…

Mr. One Database

Tables and Indexes created by DBT2

August 25th, 2011

For those who didn’t know, DBT2 is an implementation of TPCC benchmark. Following is a list of tables and indexes created:
Read more…

Mr. One Database

The overhead size for each tuple in a Postgresql table

August 17th, 2011

A quick take-away message: in version 9.0.4 of Postgresql, every tuple has an overhead of 24 bytes. I think this is mostly the size of OID (object ID).
Read more…

Mr. One Database

Inside PostgreSQL Shared Memory

August 5th, 2011

This is an online document. pdf

Mr. One Database

postgresql pg_xlog is not strictly a circular buffer

August 4th, 2011

Normally, we think that xlog file is like a circular buffer. We write to the same addresses again and again.
Read more…

Mr. One Database

How to configure postgresql shared buffer size

August 2nd, 2011

Within file “postgresql.conf”, variable “shared_buffers” decides the size of shared buffer used by postgresql.
Read more…

Mr. One Database

Error when compiling postgresql

July 27th, 2011

It looks like the following compiling error has something to do pg_class.h

../../../../src/include/catalog/pg_class.h:32: error: expected \u2018)\u2019 before \u2018,\u2019 token
../../../../src/include/catalog/pg_class.h:78: warning: data definition has no type or storage class
../../../../src/include/catalog/pg_class.h:78: warning: type defaults to \u2018int\u2019 in declaration of \u2018FormData_pg_class\u2019
../../../../src/include/catalog/pg_class.h:89: error: expected \u2018=\u2019, \u2018,\u2019, \u2018;\u2019, \u2018asm\u2019 or \u2018__attribute__\u2019 before \u2018*\u2019 token

Read more…

Mr. One Coding, Database

How to debug postgresql during initdb

July 25th, 2011

First, assume that you know how to debug postgresql on Linux (with gdb) during usual operations, such as the bugs appearing during a specific query processing.

Following is about how to troubleshoot problems that appear during initdb.
Read more…

Mr. One Coding, Database