Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f0OHlpq41222 for ; Wed, 24 Jan 2001 12:47:51 -0500 (EST) (envelope-from pgsql-general-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0ODxXq07075 for ; Wed, 24 Jan 2001 08:59:33 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f0ODtRw80083 for pgsql-general@postgresql.org; Wed, 24 Jan 2001 08:55:27 -0500 (EST) (envelope-from news) From: Andreas Rieke X-Newsgroups: comp.databases.postgresql.general Subject: Performance problem Date: Wed, 24 Jan 2001 14:57:10 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 66 Message-ID: <3A6EDF36.69CBF1AB@isl-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org To: kb@neuematerialien.de X-Mailer: Mozilla 4.72 [en] (WinNT; U) X-Accept-Language: de,en To: pgsql-general@postgresql.org X-Archive-Number: 200101/1165 X-Sequence-Number: 3447 Hi there, maybe anyone can help me with the following problem. Using PostgreSQL 7.03 on a Suse 6.3 Linux (kernel 2.2.13) with a P3/550 MHz, I get a performance problem with a select command which takes up to 10 seconds. The following tables are involved in this command: CREATE TABLE "property_list" ( "number" float8, "level_1_de" text, "level_1_en" text, "level_2_de" text, "level_2_en" text, ... ); CREATE TABLE "properties" ( "material_oid" oid NOT NULL, "property_list_oid" oid NOT NULL, ... ); CREATE TABLE "materials" ( "user_oid" oid NOT NULL, "material_class" oid, "is_new" bool DEFAULT 't'::bool, ... ); and the command is SELECT DISTINCT level_1_de from property_list pl, properties p, materials m where m.oid=p.material_oid and p.property_list_oid=pl.oid and m.is_new=FALSE; The command returns about 10 items. The tables mentioned contain the following number of entries: materials: 2476 properties: 30 323 property_list: 349 I hope that using INDEXes should speed up the search, but although I made several attempts, the search is too slow. Since I am not an expert on databases and PostgreSQL, maybe somebody who had similar problems is able to help me. Also, I do not know whether the DISTINCT in the SELECT statement forces the database to use algorithms which have not been optimized yet. Thanks in advance for your help, kind regards, Andreas