> Well whatdyaknow?? Being a Postgres newbie I hadn't even played with indexes
> yet. They're awesome!!
> Using Richard's suggestion of the Sub-Select in the COLUMN list, combined
> with adding some indexes, I can now return this in under 5 seconds!
Also, another way to improve preformance will be
sno
ON soh_product
USING btree
(soh_num);
-Original Message-
From: Richard Broersma Jr [mailto:[EMAIL PROTECTED]
Sent: Friday, 30 June 2006 10:51
To: Phillip Smith; pgsql-sql@postgresql.org
Subject: Re: [SQL] SELECT Aggregate
> I've tried Aaron's suggestion
> I've tried Aaron's suggestion of the GROUP BY and I don't know much about
> it, but it ran for around 17 hours and still going (it had a dedicated Dual
> Xeon 3.0GHz box under RHEL4 running it!)
Maybe, this query that you are trying to run is a good candidate for a
"Materialize View".
http://ar
: Friday,
30 June 2006 01:25
To: Richard Broersma Jr
Cc: Phillip Smith;
pgsql-sql@postgresql.org
Subject: Re: [SQL] SELECT
Aggregate
I am
not familiar enough with how postgres optimizes the queries but won't this end
up with
total number of queries run on DB = 1 query + 1 query/row in
I am not familiar enough with how postgres optimizes the queries but won't this end up with total number of queries run on DB = 1 query + 1 query/row in first queryWhat would be more efficient on a large database - a query like Richard submitted (subquery in the select) or one like I submitted (joi
> > SELECT trans_no,
> > customer,
> > date_placed,
> > date_complete,
> > date_printed,
> > ord_type,
> > ord_status,
(select SUM(sell_price) -- this syntax working for me. see
below
f
> SELECT trans_no,
> customer,
> date_placed,
> date_complete,
> date_printed,
> ord_type,
> ord_status,
select (
SUM(sell_price)
from soh_product
I would recommend against using a function. If you are selecting a large number of rows, the function will run for each row returned and will have to do a select for each row. So if you get 1000 rows returned from your query, you will end up with 1001 select statements for your one query.
Assumin
Hi all,
I have two tables which are storing all our sales orders /
invoices as below. sales_order.trans_no and soh_product.soh_num are the common
columns. This is PostgreSQL 8.1.4 (ie, the latest release)
We have some issues that I’ve been able to identify
using this SELECT:
SELECT