Received: from dns.whnet.edu.cn (dns.whnet.edu.cn [202.112.20.131]) by hub.org (8.9.1/8.9.1) with SMTP id VAA22348 for ; Thu, 19 Nov 1998 21:41:16 -0500 (EST) (envelope-from sqyang@nudt.edu.cn) Received: from ns (ns.csit.edu.cn) by dns.whnet.edu.cn (5.x/SMI-SVR4) id AA16375; Fri, 20 Nov 1998 09:37:09 +0800 Received: from ysq ([202.197.11.54]) by ns (4.1/SMI-4.1) id AA29538; Fri, 20 Nov 98 10:37:21 CST Sender: post64@nudt.edu.cn Message-Id: <3658CB52.6C41908F@nudt.edu.cn> Date: Mon, 23 Nov 1998 10:41:22 +0800 From: sqyang Organization: GalaxyDB Cor. X-Mailer: Mozilla 3.01Gold (X11; I; Linux 2.0.30 i686) Mime-Version: 1.0 To: pgsql-sql@postgreSQL.org Subject: optimization Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 1. I had install postgresql-v6.4 on my linux2.0.3. And it runs well. I had created two tables and inserted 2000 tuples in each of them. But pg_class shows that the two tables both contain 0 tuples and have 0 blocks. 2. I'd like to know what optimizations the postgresql takes for nestloop join. I list the execution plan of selection statement. I found that the plan relies only on the order in which the tables occur in the select list. It seems there is no optimization for nestloop join.Here are four statements and their result plans.(onek: 1000 tuples, tenk 10000 tuples) statement: select onek.unique1, tenk.unique1 from onek, tenk; plan: Nested Loop (cost=0.00 size=1 width=8) -> Seq Scan on tenk (cost=0.00 size=0 width=4) -> Seq Scan on onek (cost=0.00 size=0 width=4) statement: select onek.unique1, tenk.unique1 from tenk, onek; plan: Nested Loop (cost=0.00 size=1 width=8) -> Seq Scan on tenk (cost=0.00 size=0 width=4) -> Seq Scan on onek (cost=0.00 size=0 width=4) statement: select tenk.unique1, onek.unique1 from onek, tenk; plan: Nested Loop (cost=0.00 size=1 width=8) -> Seq Scan on onek (cost=0.00 size=0 width=4) -> Seq Scan on tenk (cost=0.00 size=0 width=4) statement: select tenk.unique1, onek.unique1 from tenk, onek; plan: Nested Loop (cost=0.00 size=1 width=8) -> Seq Scan on onek (cost=0.00 size=0 width=4) -> Seq Scan on tenk (cost=0.00 size=0 width=4) Are these conclusions true? Thanks in advance!