Monthly Archives: January 2011

Postgres Reliability

Cache in the disk drive controller; this is particularly common on RAID controller cards. Some of these caches are: Write-through cache -meaning writes are sent to the drive as soon as they arrive Write-back cache – meaning data is sent … Continue reading

Posted in Uncategorized | Leave a comment

Postgresql Configuration Parameters

================Parameters in Postgresql.conf================== – shared_buffers = 1/4 of RAM or 25% – 40% of RAM – effective_cache_size = 1/2 – 3/4 or 60-75% of RAM – checkpoint_segments = 10 segments Each segment is 16MB, 10 segments will be flushed to … Continue reading

Posted in PostgreSQL DBA Stuff | Leave a comment

Regular Expression -2

Matching Patterns in Text: The Basics Character literals /a/ Mary had a little lamb. And everywhere that Mary went, the lamb was sure to go. /Mary/ Mary had a little lamb. And everywhere that Mary went, the lamb was sure … Continue reading

Posted in Uncategorized | Leave a comment

SED tutorial

Table of Contents * The Awful Truth about sed * The essential command: s for substitution * The slash as a delimiter * Using & as the matched string * Using \1 to keep part of the pattern * Substitute … Continue reading

Posted in Uncategorized | Leave a comment

Perl snippets

To delete a line and its next line with pattern matching perl -0777 -pe ‘s/.*\n.*<pattern>.*\n.*\n//g’ file

Posted in Uncategorized | Leave a comment

Regular Expression

Regular Expression my_column has values like Example: AA001 Query to list any character not matching the format of ([A-Za-z][A-Za-z][0-9][0-9][0-9]) will be listed select my_column from my_table where my_column !~ ‘([A-Za-z][A-Za-z][0-9][0-9][0-9])’; Matching a list of characters Unlike the previous examples, these … Continue reading

Posted in Uncategorized | Leave a comment

Postgresql Configuration

Postgresql Configuration * 1 View currently running queries * 2 Change lock file location * 3 PostgreSQL vacuum * 4 PG Buffer Cache (shared_buffers) * 5 Working memory (work_memory) * 6 Check points * 7 Linux kernel system settings – … Continue reading

Posted in PostgreSQL DBA Stuff | Leave a comment