pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sqyang <sqyang@nudt.edu.cn>
To: pgsql-sql@postgreSQL.org
Subject: optimization
Date: Mon, 23 Nov 1998 10:41:22 +0800
Message-ID: <3658CB52.6C41908F@nudt.edu.cn> (raw)

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!



view thread (2+ messages)

Message-ID: <3658CB52.6C41908F@nudt.edu.cn>
Permalink:  ../3658CB52.6C41908F@nudt.edu.cn/
Also on:    postgresql.org/message-id/3658CB52.6C41908F@nudt.edu.cn

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: sqyang@nudt.edu.cn
  Subject: Re: optimization
  In-Reply-To: <3658CB52.6C41908F@nudt.edu.cn>
  References: <3658CB52.6C41908F@nudt.edu.cn>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox