Re: [SQL] Slow Query problem

2008-01-29 Thread Premsun Choltanwanich
I already install the latest version of PostgreSQL on my machine then try again. I found that it has a little improvement about 0.5 second but I think it still slow.   What is the 'more detail' you need?   Any other advise?       >>> Tom Lane <[EMAIL PROTECTED]> 1/29/2008 0:20 >>>Andreas Joseph K

Re: [SQL] Slow Query problem

2008-01-29 Thread Andreas Joseph Krogh
On Tuesday 29 January 2008 09:18:00 Premsun Choltanwanich wrote: > I already install the latest version of PostgreSQL on my machine then try > again. I found that it has a little improvement about 0.5 second but I > think it still slow. > > What is the 'more detail' you need? Your tables, views an

[SQL] Slow GROUP BY query

2008-01-29 Thread Stuart Brooks
I have a very simple table set: Transactions: transaction_key PRIMARY KEY client TEXT time TIMESTAMP LineItems transaction_key INT amount INT A query to print the contents of transactions with a sum of the line item amounts provides a very suboptimal result. The problem seems to be the GROUP

[SQL] JOINing SET returning function.

2008-01-29 Thread Dawid Kuroczko
Hi, I have a set returning function returning variable number of rows (RETURNS SETOF RECORD). I have a table which contains a list of input values for this SRF. I want to write SQL which will return all the data found there. A simple test case: a tble CREATE TEMP TABLE list (n int); INSERT INT

Re: [SQL] Slow Query problem

2008-01-29 Thread Premsun Choltanwanich
SQL I use for create related table and view:     CREATE TABLE t_payment_detail(  "sysid" bigserial NOT NULL,  receiptno varchar(10) NOT NULL,  refpath varchar(255) NOT NULL,  refno varchar(100) NOT NULL,  CONSTRAINT t_payment_detail_pkey PRIMARY KEY ("sysid")) WITHOUT OIDS;   CREATE TABLE t_recei

Re: [SQL] Slow Query problem

2008-01-29 Thread Premsun Choltanwanich
SQL I use for create related table and view:     CREATE TABLE t_payment_detail(  "sysid" bigserial NOT NULL,  receiptno varchar(10) NOT NULL,  refpath varchar(255) NOT NULL,  refno varchar(100) NOT NULL,  CONSTRAINT t_payment_detail_pkey PRIMARY KEY ("sysid")) WITHOUT OIDS;   CREATE TABLE t_recei

[SQL] Re: Proposed archival read only trigger on rows - prevent history modification

2008-01-29 Thread Steve Midgley
At 07:50 PM 1/29/2008, [EMAIL PROTECTED] wrote: Date: Mon, 28 Jan 2008 20:16:35 -0800 From: Bryce Nesbitt <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Subject: Proposed archival read only trigger on rows - prevent history modification [snip] I'm considering building a protective mechanism,