Search
Recent Visitors
Cristian - Thu 19 Feb 2009 01:10 AM PST 
April Lorenzen - Fri 11 Apr 2008 08:31 AM PDT 
kitchen - Wed 23 May 2007 11:00 PM PDT 
Al Turtle - Fri 24 Mar 2006 04:52 PM PST 
Lelain - Sun 19 Feb 2006 10:17 PM PST 
This Month
May 2006
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Year Archive
Login
User name:
Password:
Remember me 
View Article  How to log long running queries in postgresql
Locate your postgresql.conf

locate postgresql.conf

Assuming you are a highly skilled super user who fully understands and is responsible for all configuration changes s/he makes, edit postgresql.conf

vi postgresql.conf

Find the section with the log_min_duration_statement option:

/log_min_duration_statement

For the purpose of finding out what to improve, I set mine like this:

log_min_duration_statement = 250        # -1 is disabled, 0 logs all statements
                                                            # and their durations, in milliseconds.

A reload is all that is necessary to cause pg to use the new duration - at least after uncommenting the line. I used restart a few times and then successfully tried reload.

Since I am using Debian:

/etc/init.d/postgresql-8.1 reload

My postgresql logs are here:

tail -f  /var/log/postgresql/postgresql-8.1-main.log

After finding and fixing some long running queries, be sure to edit your postgresql.conf again and set the

log_min_duration_statement = -1

to turn off the function. Just commenting pg conf file settings out does not guarantee they will return to default, according to pg references I have read.

Be sure to reload and tail the log file to ensure that settings are back to performance mode.

See Power PostgreSQL website for more performance tuning info.
View Article  Eliminate Duplicates from Postgresql Tables
I use Cold Fusion to loop over a distinct query for the table that contains the duplicates. Note that your table needs to have OIDs, or a unique primary key.

column_a is the key field I want to eliminate duplicates on

SELECT distinct column_a
FROM table_a;

CFLOOP over the above query - query_a

DELETE FROM table_a
WHERE column_a = #query_a.column_a#
AND OID < (
    SELECT OID
    FROM table_a
    WHERE column_a = #query_a.column_a#
    ORDER BY OID DESC
    LIMIT 1
);

/CFLOOP
View Article  How to change the SMTP port to 587 in Eudora
Many Internet access ISPs now block port 25. To access an outbound server other than your access ISPs, you can ...   more »
View Article  Your Home Computer is Infected with a Virus
As a computer consultant I advise many of my business clients also on their home computers, and some have software ...   more »
View Article  Autosave for Webmail Composing
If you get logged out of webmail - you can now log back in and click the Compose link to restore your work:



Click the OK button and the text you had typed so far will be restored.
more »
View Article  How to use Blogware as a non-blog website (Part One)
Setting aside the blogging/journalling features, Blogware is quite a nice CMS (Content Management System) for websites. CMS usually cost thousands, ...   more »
View Article  How to add Podcasting to your Blogware blog
Your site visitors can just click on the attachment to hear your MP3. However, if they use ipodder software - they will automatically get your new podcasts when you add them to your site. Their software checks for new recordings at scheduled intervals and automatically downloads your podcast and adds it to their playlist.   more »
View Article  How to change the background color of your Blogware blog
If you see a color and style you like on this page just click the radio button next to it and then click Change at the bottom of the page. If you prefer to put in your own color directly, read on.   more »
View Article  How to add a contact info signature to email
Email signatures are a great subtle form of advertising, bringing you new business through personal networking. People who correspond with you usually need your web address, phone fax and mailing address, so it also saves a lot of typing.   more »
View Article  Joy of IMAP - How to view one email account from multiple computers
Written for a user who asked for a way to get his mail from multiple computers, home and travelling. Often ...   more »
View Article  How to Link a PDF to your Website
Written for the novice, this article details three steps - 1. upload the PDF, 2. discover and copy the web address of the PDF, 3. create a hyperlink. Tips on avoiding common mistakes in naming files as well entre to the secret world of A HREF for non-programmers.   more »