Ok, it's time to release your software product in a production environment !
You need to analyze your database and collect some data, just to know what are the most problematic queries.
I read this interesting article by Tom Copeland
but it's pretty old.
Let's follow these instructions:
your dabatase should log all the queries executed. My db is postgreSQL 8.3, so:
- sudo vim /etc/postgresql/8.3/main/postgresql.conf and edit:
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'
- sudo /etc/init.d/postgresql-8.3 reload
- cp /var/log/messages log.txt
- (i start to clear my file with this: grep -v "CET DETAIL" log.txt > log.txt)
- grep select log.txt | cut -d ' ' -f 13- | sort | uniq -c | sort -nr | less (execute it without some pipe to understanding the meaning)
Now you know what are the most famous queries.
My suggestion is to start from here, adding custom data in used tables and executing the first two or three queries found before.
Nessun commento:
Posta un commento