Re: [PERFORM] need to speed up query

2008-05-06 Thread Justin
PFC wrote: What is a "period" ? Is it a month, or something more "custom" ? Can periods overlap ? No periods can never overlap. If the periods did you would be in violation of many tax laws around the world. Plus it you would not know how much money you are making or losing. I

Re: [PERFORM] need to speed up query

2008-05-06 Thread Justin
it worked it had couple missing parts but it worked and ran in 3.3 seconds. *Thanks for this * i need to review the result and balance it to my results as the Accountant already went through and balanced some accounts by hand to verify my results <> You might want to consider a denormalized

Re: [PERFORM] need to speed up query

2008-05-06 Thread Shaun Thomas
On Tue, 2008-05-06 at 03:01 +0100, Justin wrote: > i've had to write queries to get trail balance values out of the GL > transaction table and i'm not happy with its performance Go ahead and give this a try: SELECT p.period_id, p.period_start, p.period_end, a.accnt_id, a.accnt_number, a.a

Re: [PERFORM] need to speed up query

2008-05-06 Thread PFC
What is a "period" ? Is it a month, or something more "custom" ? Can periods overlap ? No periods can never overlap. If the periods did you would be in violation of many tax laws around the world. Plus it you would not know how much money you are making or losing. I was wondering

Re: [PERFORM] need to speed up query

2008-05-06 Thread Justin
PFC wrote: i've had to write queries to get trail balance values out of the GL transaction table and i'm not happy with its performance The table has 76K rows growing about 1000 rows per working day so the performance is not that great it takes about 20 to 30 seconds to get all the records

Re: [PERFORM] need to speed up query

2008-05-05 Thread PFC
i've had to write queries to get trail balance values out of the GL transaction table and i'm not happy with its performance The table has 76K rows growing about 1000 rows per working day so the performance is not that great it takes about 20 to 30 seconds to get all the records for the t

Re: [PERFORM] need to speed up query

2008-05-05 Thread Justin
Gregory Williamson wrote: Justin -- You wrote: > > i've had to write queries to get trail balance values out of the GL > transaction table and i'm not happy with its performance > > > The table has 76K rows growing about 1000 rows per working day so the > performance is not that great it take

Re: [PERFORM] need to speed up query

2008-05-05 Thread Justin
yes the cross join is intentional. Thanks creating the two column index drop processing time to 15 to 17 seconds put per period down to 1 second Scott Marlowe wrote: You're joining these two tables: period, accnt, but I'm not seeing an on () clause or a where clause joining them. Is the cr

Re: [PERFORM] need to speed up query

2008-05-05 Thread Gregory Williamson
Justin -- You wrote: > > i've had to write queries to get trail balance values out of the GL > transaction table and i'm not happy with its performance > > > The table has 76K rows growing about 1000 rows per working day so the > performance is not that great it takes about 20 to 30 seconds

Re: [PERFORM] need to speed up query

2008-05-05 Thread Scott Marlowe
You're joining these two tables: period, accnt, but I'm not seeing an on () clause or a where clause joining them. Is the cross product intentional? But what I'm seeing that seems like the lowest hanging fruit would be two column indexes on the bits that are showing up in those bit map scans. Li

[PERFORM] need to speed up query

2008-05-05 Thread Justin
i've had to write queries to get trail balance values out of the GL transaction table and i'm not happy with its performance The table has 76K rows growing about 1000 rows per working day so the performance is not that great it takes about 20 to 30 seconds to get all the records for the table