Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query Speed

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-15 : 08:58:43
Anthony writes "i have 2 million records in two seperate tables inside a database on sql 2000 running nt4. When i ask for the data from both table about 8 fields using a date range i get 90,000 records back in about 55 seconds this stinks considering i can link the tables inside access and get a return recordset in 15 seconds. I must be doing something wrong i hope."

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2002-01-15 : 09:08:46
Do you have any indexes on the two tables? Are you using the same join methodology in SQL Server as in Access (ANSI as opposed to where clause joins)? Can you post your query so we can get a look at it and point out any possible bottlenecks?

Justin

Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2002-01-15 : 09:13:09
A quick easy way is to use query analyzer's "Perform Index Analysis" option. It's a good place to start and get an idea of what SQL uses as an optimized query. As a beginner, it's good, as you become more advanced, indexing will be more intuitive for you and you won't really need to rely on that option


Mike
"A program is a device used to convert data into error messages."
Go to Top of Page

mono
Starting Member

36 Posts

Posted - 2002-01-15 : 12:01:26
What you are seeing in the Access *recordset* may just be the time taken to return the first page or screenful of records. Do MoveLast to force retrieval of the complete set or disable recordset paging to level the playing field.

If you are using the same SQL in both, then be aware that there are differences in the interpretation of the JOIN syntax, so perhaps SQL Server is running a CROSS JOIN where Access runs an OUTER.



Go to Top of Page
   

- Advertisement -