>I have a table setup in a SQL Server 7.0 database with 1.5 million records. Doing a very simple query, on an indexed field, in the Query Analyzer on the server machine itself, seems very slow. -Considerably slower than running the same query on a VFP table on the same machine. I'm talking about 27 seconds for a return of 12,000 records from a query like:
>
>SELECT MyField FROM MyDBC.dbo.MyTable WHERE MyField = 'MyValue'
>
>There is an index on MyField.
>The statistics report usually shows about 23 logical reads.
>
>There has to be something I'm doing wrong. Any suggestions would be very appreciated!
At a first guess, it sounds like you are seeing one of VFP's rushmore tricks in action. If the index is relatively small then vfp can often beat out sql servers on a simple record access. The reason is ... it only brings the index across the network. Then just retrieves the records it needs. With caching and various rushmore optimisations it can really get up and move.
For a better test of sql over vfp however ... try running a sum on all those 1.5 milling records. Then you will see a big difference
SQL sends just one record as the result ... VFP has to pull all records over the net to get the result.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only