pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: markus brosch <brosch@gmx.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: max length of sql select statement ?
Date: 09 Jul 2003 17:02:20 +0000
Message-ID: <1057770139.46100.93.camel@jester> (raw)
In-Reply-To: <1057765894.1533.40.camel@sam>
References: <1057592658.881.93.camel@sam>
	<1101.219.65.226.199.1057593454.squirrel@mail.trade-india.com>
	<1057594050.886.104.camel@sam>
	<1057594852.46100.11.camel@jester>
	<1057743944.15655.12.camel@sam>
	<1057757398.46100.63.camel@jester>
	<1057764847.863.34.camel@sam>
	<1057765512.46100.84.camel@jester>
	<1057765894.1533.40.camel@sam>

On Wed, 2003-07-09 at 15:51, markus brosch wrote:
> On Wed, 2003-07-09 at 17:45, Rod Taylor wrote:
> > > Nobody a better idea? Why is the join of a temporary table (the IN
> > > paramters) and the original table so slow? Any tricks here? 
> > 
> > Did you index and ANALYZE the temporary table?
> 
> No!
> 
> I have to do this "strange" and "long" statement also a view thousand
> times ... so I always have to create the temp table again and again and
> if I index the table it costs me more time. 

So.. which costs more.  Building the index + fast query or doing the
slow query?

If you have anything more than a thousand lines in the temp table, I bet
indexing it would be the better way to go.

> As far I am relativly new to SQL, I ask you:
> Where's the difference between and indexed temp (!!!) table and an
> unindexed one? The main table is of course fully indexed ;-)

One has an index, which means that other (much faster) methods may be
available for the database to use.

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (14+ messages)  latest in thread

Message-ID: <1057770139.46100.93.camel@jester>
Permalink:  ../1057770139.46100.93.camel@jester/
Also on:    postgresql.org/message-id/1057770139.46100.93.camel@jester

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rbt@rbt.ca, brosch@gmx.de
  Subject: Re: max length of sql select statement ?
  In-Reply-To: <1057770139.46100.93.camel@jester>

* 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