Complex SQL query and performance strategy

From: Adam Witney <awitney(at)sghms(dot)ac(dot)uk>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Complex SQL query and performance strategy
Date: 2002-10-09 10:32:18
Message-ID: B9C9C442.9324%a.witney@sghms.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-10-09 13:32:50 Re: [pgsql-performance] Large databases, performance
Previous Message Richard Huxton 2002-10-09 10:20:27 Re: PLPGSQL errors