[SQL] Slow Query problem

2008-01-27 Thread Premsun Choltanwanich
Dear All, I am currently using PostgreSQL database version 8.0.13.  My problem relates to a slow result when a query using a defined view joins to another table for a result. Background:  I have 7 tables of invoice transactions.  The tables are slightly different in that they record different dat

Re: [SQL] Slow Query problem

2008-01-28 Thread Andreas Joseph Krogh
On Monday 28 January 2008 08:18:24 Premsun Choltanwanich wrote: > Dear All, > > I am currently using PostgreSQL database version 8.0.13. My problem > relates to a slow result when a query using a defined view joins to another > table for a result. > > Background: I have 7 tables of invoice transa

Re: [SQL] Slow Query problem

2008-01-28 Thread Tom Lane
Andreas Joseph Krogh <[EMAIL PROTECTED]> writes: > On Monday 28 January 2008 08:18:24 Premsun Choltanwanich wrote: >> I am currently using PostgreSQL database version 8.0.13. My problem >> relates to a slow result when a query using a defined view joins to another >> table for a result. > It is v

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

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