Re: [PERFORM] insert

2011-07-29 Thread Kevin Grittner
alan wrote: > Can I write a BEFORE ROW trigger for the products table to runs > on INSERT or UPDATE to > 1. insert a new category & return the new category_id OR > 2. return the existing category_id for the (to be inserted row) What would you be using to match an existing category? If th

Re: [PERFORM] heavy load-high cpu itilization

2011-07-29 Thread Scott Marlowe
On Mon, Jul 25, 2011 at 12:00 PM, Filippos wrote: > Dear all > > first of all congratulations on your greak work here since from time to time > i 've found many answers to my problems. unfortunately for this specific > problem i didnt find much relevant information, so i would ask for your > guida

Re: [PERFORM] Performance penalty when using WITH

2011-07-29 Thread Tom Lane
Li Jin writes: > Anyone knows why the planner is doing this? WITH is an optimization fence. This is intentional and documented. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://

[PERFORM] issue related to logging facility of postgres

2011-07-29 Thread shailesh singh
Hi, I want to configure Logging of postgres in such a way that messages of different severity should be logged in different log file. eg: all ERROR message should be written in error-msg.log file while all NOTICE mesage should be written in notice-msg.log file. In order to do that what changes sho

Re: [PERFORM] UPDATEDs slowing SELECTs in a fully cached database

2011-07-29 Thread lars hofhansl
Thanks Pavan! I think the most important points are still that: 1. The WAL write should be happening asynchronously (if that is possible) 2. There should be an option do not perform these compactions if the page is only touched by reads. (Assuming that when most of the databaseresides in the ca

[PERFORM] insert

2011-07-29 Thread alan
next question. I have a product table with a 'category" column that I want to maintain in a separate table. CREATE TABLE products ( product_id INTEGER DEFAULT nextval('product_id_seq'::regclass) NOT NULL, name VARCHAR(60) NOT NULL, category SMALLINT

[PERFORM] Performance penalty when using WITH

2011-07-29 Thread Li Jin
Hi guys, I met with the problem that when I was using WITH clause to reuse a subquery, I got a huge performance penalty because of query planner. Here are the details, the original query is EXPLAIN ANALYZE WITH latest_identities AS ( SELECT DISTINCT ON (memberid) memberid, username, change

Re: [PERFORM] [ADMIN] Restore database after drop command

2011-07-29 Thread Vibhor Kumar
On Jul 25, 2011, at 12:08 PM, Adarsh Sharma wrote: > I restore globedatabase from a .sql file on yesterday morning.I insert some > new data in that database. > In the evening, by mistake I issued a drop database globedatabase command. > Today morning, I restore again the same database from backu

[PERFORM] heavy load-high cpu itilization

2011-07-29 Thread Filippos
Dear all first of all congratulations on your greak work here since from time to time i 've found many answers to my problems. unfortunately for this specific problem i didnt find much relevant information, so i would ask for your guidance dealing with the following situation: we have a dedicated

Re: [PERFORM] insert

2011-07-29 Thread alan
I think I figured it out myself. If anyone sees issues with this (simple) approach, please let me know. I changed my table definitions to this: CREATE SEQUENCE public.product_id_seq CREATE TABLE products ( product_id INTEGER DEFAULT nextval('product_id_seq'::regclass) NOT NULL, name VARCH

Re: [PERFORM] Bad query plan

2011-07-29 Thread Gavin Flower
On 25/07/11 02:06, Дмитрий Васильев wrote: I have a problem with poor query plan. My PostgreSQL is "PostgreSQL 8.4.8, compiled by Visual C++ build 1400, 32-bit" installed by EnterpriseDB installer on Windows 7 32 bit. Steps to reproduce: Start with fresh installation and execute the following:

Re: [PERFORM] Trigger or Function

2011-07-29 Thread alan
> My first approach would be to remove WeekAvg and MonthAvg from the > table and create a view which calculates appropriate values. Thanks Robert, I had to upgrade to 9.0.4 to use the extended windowing features. Here is how I set it up. If anyone sees an issue, please let me know. I'm new to post

Re: [PERFORM] Queries related to checkpoints

2011-07-29 Thread Kevin Grittner
Rohan Malhotra wrote: First off, for a one-row result with too many values to fit on one line, you might want to use this in psql: \x on More importantly, you seem to be misinterpreting the numbers. You've allocated 2,205,969,940 buffers. Of those allocations, the allocating backend had t

[PERFORM] Queries related to checkpoints

2011-07-29 Thread Rohan Malhotra
Hi, I am a Noob with db tuning and trying to analyze pg_stats_brwriter data checkpoints_timed | checkpoints_req | buffers_checkpoint | buffers_clean | maxwritten_clean | buffers_backend | buffers_alloc ---+-++---+--