pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Witney <awitney@sghms.ac.uk>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Complex SQL query and performance strategy
Date: Wed, 09 Oct 2002 11:32:18 +0100
Message-ID: <B9C9C442.9324%a.witney@sghms.ac.uk> (raw)
In-Reply-To: <3D9B3650.3040000@joeconway.com>


Hi,

I have a complex SQL query which requires the joining of 18 tables. There
are only primary key indices on the table and at the moment it runs a little
slow (30s or so) and so I am trying to optimise it.

The output of EXPLAIN is a little confusing and seems to vary from run to
run. Does the query optimiser have trouble with larger number of table
joins?

Also this will be running from a web front end, and I hope to have it
encapsulated all within a function. Would it be better to break it up into
multiple SQL statements/functions? Or to try to really tweak the indices?

Thanks for any advice

adam


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




view thread (2+ messages)  latest in thread

Message-ID: <B9C9C442.9324%a.witney@sghms.ac.uk>
Permalink:  ../B9C9C442.9324%25a.witney@sghms.ac.uk/
Also on:    postgresql.org/message-id/B9C9C442.9324%a.witney@sghms.ac.uk

 · 

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: awitney@sghms.ac.uk
  Subject: Re: Complex SQL query and performance strategy
  In-Reply-To: <B9C9C442.9324%a.witney@sghms.ac.uk>

* 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