Received: from mail.tol.it (mail.tin.it [194.243.154.49]) by hub.org (8.8.8/8.8.8) with ESMTP id DAA25037 for ; Wed, 16 Sep 1998 03:19:06 -0400 (EDT) (envelope-from infotecn@tin.it) Received: from Server.InfoTecna.com (a-mz7-12.tin.it [212.216.9.139]) by mail.tol.it (8.8.4/8.8.4) with ESMTP id JAA29266; Wed, 16 Sep 1998 09:19:01 +0200 (MET DST) Received: from tm3.InfoTecna.com (Tm1.InfoTecna.com [192.168.1.1]) by Server.InfoTecna.com (8.8.5/8.8.5) with SMTP id JAA06842; Wed, 16 Sep 1998 09:03:50 +0200 Message-Id: <3.0.6.32.19980916090349.00807d10@MBox.InfoTecna.com> X-Sender: denis@MBox.InfoTecna.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Wed, 16 Sep 1998 09:03:49 +0200 To: Greg Youngblood From: Sbragion Denis Subject: Re: [INTERFACES] Problems with queries on small/medium sized tables Cc: pgsql-interfaces@postgreSQL.org In-Reply-To: <2B9713A99045D211BB4E0008C75668690B0FFE@SCORPEXC1.houstonce ll.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, At 13.00 15/09/98 -0500, you wrote: >I am having a problem with queries. > ... >The following query is used: > SELECT usage.* > FROM usage > WHERE > (((usage.yyyymmdd) Between 19980701 And 19980731) > AND ((usage.link)='swbt08')) OR (((usage.link)='swbtja')) > ORDER BY > usage.yyyymmdd, usage.hhmm, usage.stp, usage.link; > >When run from psql the answer is returned fairly quickly. When run from >Access via ODBC, the system memory starts increasing until it gets to 60/70% >on the single postgres process, and CPU is usually below 10% (normal queries >shoot CPU up to 50 to 99 % and memory stays around 3 to 8 percent). Then the >ODBC call fails and Access doesn't get any information. the jet database engine often parses and rewrites queries to get simpler ones. Sometimes these simpler queries contain many "OR" in the where clause and the backend optimizer crashes on them. Use the trace feature of the ODBC to see exactly which kind of queries are sent to the backend. To solve it you have to use passthrough queries, but I have no idea how this can be done in Access. Hope it helps. Bye! Dr. Sbragion Denis InfoTecna Tel, Fax: +39 39 2324054 URL: http://space.tin.it/internet/dsbragio