X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D469453CAD for ; Fri, 15 Apr 2005 10:12:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04116-05 for ; Fri, 15 Apr 2005 13:12:23 +0000 (GMT) Received: from vms040pub.verizon.net (vms040pub.verizon.net [206.46.252.40]) by svr1.postgresql.org (Postfix) with ESMTP id D080453B91 for ; Fri, 15 Apr 2005 10:12:21 -0300 (ADT) Received: from jfradkin ([63.162.100.127]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IEZ007RLOOOYAN7@vms040.mailsrvcs.net> for pgsql-performance@postgresql.org; Fri, 15 Apr 2005 08:12:26 -0500 (CDT) Date: Fri, 15 Apr 2005 09:12:25 -0400 From: "Joel Fradkin" Subject: Re: speed of querry? In-reply-to: <49E94D0CFCD4DB43AFBA928DDD20C8F9026184B2@asg002.asg.local> To: "'Dave Held'" , "'PERFORM'" Message-id: <000001c541bc$c538fab0$797ba8c0@jfradkin> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Outlook, Build 10.0.6626 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200504/340 X-Sequence-Number: 11737 It is still slower on the Linux box. (included is explain with SET enable_seqscan =3D off; explain analyze select * from viwassoclist where clientnum =3D'SAKS') = See below. I did a few other tests (changing drive arrays helped by 1 second was = slower on my raid 10 on the powervault). Pulling just raw data is much faster on the Linux box. "Seq Scan on tblresponse_line (cost=3D100000000.00..100089717.78 = rows=3D4032078 width=3D67) (actual time=3D0.028..4600.431 rows=3D4032078 loops=3D1)" "Total runtime: 6809.399 ms" Windows box "Seq Scan on tblresponse_line (cost=3D0.00..93203.68 rows=3D4031968 = width=3D67) (actual time=3D16.000..11316.000 rows=3D4031968 loops=3D1)" "Total runtime: 16672.000 ms" I am going to reload the data bases, just to see what I get. I am thinking I may have to flatten the files for postgres (eliminate = joins of any kind for reporting etc). Might make a good deal more data, but I think from the app's point of view it is a good idea anyway, just not = sure how to handle editing. Joel Fradkin =20 "Merge Join (cost=3D49697.60..50744.71 rows=3D14987 width=3D113) = (actual time=3D11301.160..12171.072 rows=3D160593 loops=3D1)" " Merge Cond: ("outer".locationid =3D "inner".locationid)" " -> Sort (cost=3D788.81..789.89 rows=3D432 width=3D49) (actual time=3D3.318..3.603 rows=3D441 loops=3D1)" " Sort Key: l.locationid" " -> Index Scan using ix_location on tbllocation l (cost=3D0.00..769.90 rows=3D432 width=3D49) (actual time=3D0.145..2.283 = rows=3D441 loops=3D1)" " Index Cond: ('SAKS'::text =3D (clientnum)::text)" " -> Sort (cost=3D48908.79..49352.17 rows=3D177352 width=3D75) = (actual time=3D11297.774..11463.780 rows=3D160594 loops=3D1)" " Sort Key: a.locationid" " -> Merge Right Join (cost=3D26247.95..28942.93 rows=3D177352 width=3D75) (actual time=3D8357.010..9335.362 rows=3D177041 loops=3D1)" " Merge Cond: ((("outer".clientnum)::text =3D "inner"."?column10?") AND ("outer".id =3D "inner".jobtitleid))" " -> Index Scan using ix_tbljobtitle_id on tbljobtitle jt (cost=3D0.00..243.76 rows=3D6604 width=3D37) (actual = time=3D0.122..12.049 rows=3D5690 loops=3D1)" " Filter: (1 =3D presentationid)" " -> Sort (cost=3D26247.95..26691.33 rows=3D177352 = width=3D53) (actual time=3D8342.271..8554.943 rows=3D177041 loops=3D1)" " Sort Key: (a.clientnum)::text, a.jobtitleid" " -> Index Scan using ix_associate_clientnum on tblassociate a (cost=3D0.00..10786.17 rows=3D177352 width=3D53) (actual time=3D0.166..1126.052 rows=3D177041 loops=3D1)" " Index Cond: ((clientnum)::text =3D = 'SAKS'::text)" "Total runtime: 12287.502 ms" This is above and beyond toying with the column statistics. You are basically telling the planner to use an index. Try this, and post the EXPLAIN ANALYZE for the seqscan =3D off case on the slow box if it doesn't speed things up for you. __ David B. Held Software Engineer/Array Services Group 200 14th Ave. East, Sartell, MN 56377 320.534.3637 320.253.7800 800.752.8129 ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly