Received: from desertmoon.com (qmailr@desertmoon.com [198.182.124.2]) by hub.org (8.9.2/8.9.1) with SMTP id LAA51426 for ; Fri, 5 Feb 1999 11:16:37 -0500 (EST) (envelope-from pierre@desertmoon.com) From: pierre@desertmoon.com Received: (qmail 18988 invoked by uid 100); 5 Feb 1999 16:22:58 -0000 Message-ID: <19990205162258.18987.qmail@desertmoon.com> Subject: Re: [SQL] performance problems of a complex query with 2 subselects To: juris@rfb.lv (Juris) Date: Fri, 5 Feb 1999 09:22:58 -0700 (MST) Cc: pgsql-sql@postgreSQL.org In-Reply-To: <36BB1581.555A2364@rfb.lv> from "Juris" at Feb 5, 99 06:00:01 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > Hello! > > I am quite new to PostgreSQL and was hoping to use it as an alternative > to MS Access for the product catalog software I am developing (the data > is represented in a meta-model). > > I fully recreated the environment I had on MS Access (see attachment) > and tried to run the query. > > The execution time for this query on MS Access for 40000 records was > approx. 10 seconds. > First the pgsql query on 400 records just seemed to hang. I installed a > newer version of pgsql (6.4.2), created indices on the columns > used until 'explain' showed only 1 'seq search' (couldn't get rid of > that one). You need to 'vacuum analyze ' for each table that you have created AFTER you've created the indexes for them before the sql optimizer will use the indexes. This should solve most of your speed issues. I also believe that this is in the FAQ. -=pierre