Techniques

Optimising PostgreSQL application Part II

Review Part I here.  The best I could muster was 21 minutes in a co-located setup.  To make the comparison fair, I am going to express it as a percentage of the pre-optimisation application / PostgreSQL DB on production versus my development machine.

Finding lines in a text file with differing lengths

I recently had to find out whether a very large text file had any lines where the length (character count) of each line needed to be identical.  This will help:

cat file.txt | awk '{gsub(/[ \t]+$/,""); print length($0)}' | sort -u

Blog Categories:

Defensive programming good or evil?

Based on a recent discussion I had with a friend of mine, I am curious to know what other people think.

The discussion revolves around the use of defensive programming techniques, as implicitly discussed in my recent article. I am going to discuss two issues.

Blog Categories:

Subscribe to Techniques

Back to top