Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mike Gagnon
  Where is Mike Gagnon?
 Pointe Claire
 Canada
 Mike Gagnon
 To: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 Tags
Subject: RE: Max Value from 3 fields
Thread ID: 344796 Message ID: 345059 # Views: 30 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, May 17, 2012 6:03:38 PM         
   


> >
> > cetin
> >
> > On a large database (sql) this query is a killer. Might as well take the day off when you run this.
> >
> > Mike Gagnon
> > Refox XI +(English version)
>
> Hey Mike,
> A large database would be unlikely have this data design or be on a backend like VFP. "Large" is relative though, what is large for VFP is small for other backends, what was the rowcount you had in mind:) With a million rows it takes 3.6 seconds and 10 million rows 39 seconds. Didn't sound to be slow to me when it is VFP. But yet, when it is VFP there are at least 3 ways to do it. This xbase approach is faster (26 sec for 10 million rows):
>
>
Select * From myData Into Cursor crsSorted Readwrite
> Local Array laRow[5]
> Select myData
> Scan
> 	Scatter To laRow
> 	Asort(laRow,3,3)
> 	Select crsSorted
> 	Gather From laRow
> 	Select myData
> Endscan
> Select crsSorted
> Locate

>
>

> Cetin Basoz
>
> .Net has got better.Think about moving - check my blog:
> My Blog
> Blog (mirror) - sounds to be down
>

> Support Wikipedia

>>> and 10 million rows 39 seconds

Im my world that would be unacceptable. Also try this with 200 concurrent users (like a call centre). Have a timer start the process every 5 seconds until you hit 200. You may find it real slow.

Mike Gagnon
Refox XI +(English version)

ENTIRE THREAD

Max Value from 3 fields Posted by Tariq mehmood @ 5/14/2012 10:03:01 AM
RE: Max Value from 3 fields Posted by Anil Sharma @ 5/14/2012 10:24:05 AM
RE: Max Value from 3 fields Posted by tushar @ 5/14/2012 10:24:10 AM
RE: Max Value from 3 fields Posted by Anders Altberg @ 5/14/2012 1:36:22 PM
RE: Max Value from 3 fields Posted by Cetin Basoz @ 5/15/2012 1:02:17 PM
RE: Max Value from 3 fields Posted by Mike Gagnon @ 5/16/2012 12:55:43 AM
RE: Max Value from 3 fields Posted by Cetin Basoz @ 5/16/2012 3:34:59 PM
RE: Max Value from 3 fields Posted by Mike Gagnon @ 5/17/2012 6:03:38 PM
RE: Max Value from 3 fields Posted by Anders Altberg @ 5/16/2012 10:38:38 AM
RE: Max Value from 3 fields Posted by Mike Yearwood @ 5/16/2012 4:57:14 PM