From roji@mail15.com Tue Oct 7 07:53:24 2003 X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 1AB14D1B4ED for ; Tue, 7 Oct 2003 07:53:24 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 58004-03 for ; Tue, 7 Oct 2003 04:52:39 -0300 (ADT) Received: from www.mail15.com (www.mail15.com [62.118.249.44]) by svr1.postgresql.org (Postfix) with ESMTP id E188DD1B4EA for ; Tue, 7 Oct 2003 04:52:36 -0300 (ADT) Received: from deskpro ([61.94.189.86]) (authenticated bits=0) by www.mail15.com (8.12.9/8.12.6) with ESMTP id h977p7cw001461 for ; Tue, 7 Oct 2003 11:51:42 +0400 (MSD) (envelope-from roji@mail15.com) Message-ID: <004a01c38ca8$72ebdb80$1500a8c0@deskpro> From: "DenBaguse MasRodjie" To: Subject: Query takes a long time Date: Tue, 7 Oct 2003 15:54:53 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0030_01C38CEB.594C9460" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.6 tagged_above=0.0 required=5.0 tests=HTML_40_50, RCVD_IN_OSIRUSOFT_COM X-Spam-Level: * X-Archive-Number: 200310/37 X-Sequence-Number: 3350 This is a multi-part message in MIME format. ------=_NextPart_000_0030_01C38CEB.594C9460 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thank you the query is sucessfull, but i have new problem. The query takes = a long time(over 1 minute) for sub-select like below: "select distinct t.bill_no, t.ref, t.bill_byr, c.name from artagih t, arcus= tomer c, arbill_lns where t.bill_no not in (select bill_no from arbill_lns)= and t.cust_code=3Dc.cust_code and t.d_r=3Darbill_lns.d_r and t.cust_code= =3D'CUST01' order by t.tanggal" Is there something wrong with my query or do you have any suggestions? If my query is correct, where is the problem? Is it in the postgre server o= r in ODBC?=20 Is there any OLE DB for Postgre, cause i'm using VB for my front-end applic= ation. For comparison if i'm using MSDE for database server, it takes not more tha= n 5 seconds for the same query with above. With MySQL it takes over than 1 minute. I'm so confusing and stuck with thi= s problem. Thank you very much. Roji ------=_NextPart_000_0030_01C38CEB.594C9460 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Th= ank you the=20 query is sucessfull, but i have new problem. The query takes a long time(ov= er 1=20 minute) for sub-select like below:

 

"select distinct t.= bill_no,=20 t.ref, t.bill_byr, c.name from artagih t, arcustomer c, arbill_lns whe= re=20 t.bill_no not in (select bill_no from arbill_lns) and t.cust_code=3Dc.cust_= code=20 and t.d_r=3Darbill_lns.d_r and t.cust_code=3D'CUST01' order by t.tanggal"

 

Is there=20 something wrong with my query or do you have any suggestions?

If my=20 query is correct, where is the problem? Is it in the postgre server or in O= DBC?=20

Is there=20 any OLE DB for Postgre, cause i'm using VB for my front-end=20 application.

For=20 comparison if i'm using MSDE for database server, it takes not more than 5= =20 seconds for the same query with above.

With=20 MySQL it takes over than 1 minute. I'm so confusing and stuck with this=20 problem.

 

 

Thank you=20 very much.

 

 

Roji

------=_NextPart_000_0030_01C38CEB.594C9460-- From dev@archonet.com Tue Oct 7 09:11:31 2003 X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9D9DFD1B567 for ; Tue, 7 Oct 2003 09:11:31 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 69374-05 for ; Tue, 7 Oct 2003 06:10:43 -0300 (ADT) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by svr1.postgresql.org (Postfix) with ESMTP id 9EC84D1B58E for ; Tue, 7 Oct 2003 06:10:16 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 1A6nrF-0003ac-0X; Tue, 07 Oct 2003 10:10:18 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 6DF9216DBE; Tue, 7 Oct 2003 10:10:16 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id C14F216DA8; Tue, 7 Oct 2003 10:10:15 +0100 (BST) From: Richard Huxton To: "DenBaguse MasRodjie" , Subject: Re: Query takes a long time Date: Tue, 7 Oct 2003 10:10:14 +0100 User-Agent: KMail/1.5 References: <004a01c38ca8$72ebdb80$1500a8c0@deskpro> In-Reply-To: <004a01c38ca8$72ebdb80$1500a8c0@deskpro> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310071010.14939.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/38 X-Sequence-Number: 3351 On Tuesday 07 October 2003 08:54, DenBaguse MasRodjie wrote: > Thank you the query is sucessfull, but i have new problem. The query takes > a long time(over 1 minute) for sub-select like below: > > > "select distinct t.bill_no, t.ref, t.bill_byr, c.name from artagih t, > arcustomer c, arbill_lns where t.bill_no not in (select bill_no from > arbill_lns) and t.cust_code=c.cust_code and t.d_r=arbill_lns.d_r and > t.cust_code='CUST01' order by t.tanggal" > > Is there something wrong with my query or do you have any suggestions? You might want to rewrite your IN clause as EXISTS. There is plenty of discussion of this in the general/sql list archives. > If my query is correct, where is the problem? Is it in the postgre server > or in ODBC? Nobody can tell you - you haven't given run-times from psql vs odbc. Nobody can give you advice on the query's performance because you haven't shown the output of EXPLAIN ANALYSE or mentioned what hardware/configuration settings you have. > Is there any OLE DB for Postgre, cause i'm using VB for my front-end > application. > > For comparison if i'm using MSDE for database server, it takes not more > than 5 seconds for the same query with above. > > With MySQL it takes over than 1 minute. I'm so confusing and stuck with > this problem. This is a PostgreSQL list - if you are using MySQL there probably isn't much product-specific advice we can give. If you are running PG, then I'd recommend running EXPLAIN ANALYSE, and perhaps posting the results to the performance list. -- Richard Huxton Archonet Ltd