anyway to optimize this query?
Posted in 1999
Topics: SQL Development & Query Writing
hi all:
I have a 16 gig database, each record is contains 50 fields.
I am running a query like this:
select f1,f2....f15, sum(f40),sum(f41),sum(f42), sumf(43)
group by f1,f2...f15
as you see, i have to group about 15 fields and sum 4 other fields
based on that group.
now, it took me about 12 hours to run that query, my questions are:
1. is that normal speed or too slow?
2. if too slow, what are the suggestions to make it faster?
thanks a lot.
yan
In article <7a9a5e$pmq$1@news.xmission.com>,
"Yan Zhu" <yan.zhu@infinity-insurance.com> wrote:
>
>
> hi all:
> I have a 16 gig database, each record is contains 50 fields.
> I am running a query like this:
>
> select f1,f2....f15, sum(f40),sum(f41),sum(f42), sumf(43)
> group by f1,f2...f15>
> as you see, i have to group about 15 fields and sum 4 other fields
> based on that group.
> now, it took me about 12 hours to run that query, my questions are:
>
> 1. is that normal speed or too slow?
> 2. if too slow, what are the suggestions to make it faster?
>
> thanks a lot.
>
> yan
>
>
Try
select f1 || f2||....||f15, sum(f40),sum(f41),sum(f42), sumf(43)
group by 1
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own