Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 16 of 16 total
Thread Procedure - is there a faster way?
Fri, Jul 11 2008 8:41 AMPermanent Link

"John Hay"
Dieter

OK based on these structures the queries are

SELECT Zahl_1,Zahl_2,COUNT(*) AS tot FROM
(SELECT Zahl_1,Zahl_2,total.runde,count(*) from Zwei
JOIN total ON total.zahl=Zwei.Zahl_1 or total.zahl=Zwei.Zahl_2
GROUP by Zahl_1,Zahl_2,total.runde
HAVING COUNT(*) > 1) t1
GROUP BY Zahl_1,Zahl_2

If it does then maybe the following is worth a try

UPDATE Zwei SET Zahl_3 =
(SELECT tot FROM
SELECT Zahl_1,Zahl_2,COUNT(*) AS tot FROM
(SELECT Zahl_1,Zahl_2,total.runde,count(*) from Zwei
JOIN total ON total.zahl=Zwei.Zahl_1 or total.zahl=Zweir.Zahl_2
GROUP by Zahl_1,Zahl_2,total.runde
HAVING COUNT(*) > 1) t1
GROUP BY Zahl_1,Zahl_2) t2
WHERE Zwei.Zahl_1=t2.Zahl_1 and Zwei.Zahl_2=t2.Zahl_2)

John

Fri, Jul 11 2008 10:25 AMPermanent Link

Dieter Nagy
John,

wow great, it works perfect!!!!!!!!!!!!!!

Thank you very much!

Now it's a good day, the sun is shining and the SQL run perfect!

Dieter


"John Hay" <j.haywithoutdot@crbsolutionsremoveallthis.co.uk> wrote:

Dieter

OK based on these structures the queries are

SELECT Zahl_1,Zahl_2,COUNT(*) AS tot FROM
(SELECT Zahl_1,Zahl_2,total.runde,count(*) from Zwei
JOIN total ON total.zahl=Zwei.Zahl_1 or total.zahl=Zwei.Zahl_2
GROUP by Zahl_1,Zahl_2,total.runde
HAVING COUNT(*) > 1) t1
GROUP BY Zahl_1,Zahl_2

If it does then maybe the following is worth a try

UPDATE Zwei SET Zahl_3 =
(SELECT tot FROM
SELECT Zahl_1,Zahl_2,COUNT(*) AS tot FROM
(SELECT Zahl_1,Zahl_2,total.runde,count(*) from Zwei
JOIN total ON total.zahl=Zwei.Zahl_1 or total.zahl=Zweir.Zahl_2
GROUP by Zahl_1,Zahl_2,total.runde
HAVING COUNT(*) > 1) t1
GROUP BY Zahl_1,Zahl_2) t2
WHERE Zwei.Zahl_1=t2.Zahl_1 and Zwei.Zahl_2=t2.Zahl_2)

John
Fri, Jul 11 2008 12:29 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

John,

<< If it does then maybe the following is worth a try >>

Man, I think lurkers will need to get drunk first before trying to read that
query. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jul 11 2008 1:35 PMPermanent Link

Dieter Nagy
Tim,

please can you take a look at my code and tell me, why the update within the procedure take long times.

Thanks

Dieter








"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

John,

<< If it does then maybe the following is worth a try >>

Man, I think lurkers will need to get drunk first before trying to read that
query. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com
Fri, Jul 11 2008 6:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Dieter,

<< please can you take a look at my code and tell me, why the update within
the procedure take long times. >>

More than likely it's simply due to the fact that you're not using a
transaction around a series of several thousand navigational updates.  That
results in several thousand writes to disk instead of just one or a handful.


--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Jul 12 2008 5:11 AMPermanent Link

Dieter Nagy
Tim,

OK, thanks.

Dieter





"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Dieter,

<< please can you take a look at my code and tell me, why the update within
the procedure take long times. >>

More than likely it's simply due to the fact that you're not using a
transaction around a series of several thousand navigational updates.  That
results in several thousand writes to disk instead of just one or a handful.


--
Tim Young
Elevate Software
www.elevatesoft.com
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image