very general performance question

Results 1 to 5 of 5

Thread: very general performance question

  1. #1
    PJ Guest

    Default very general performance question

    Hello. I regularly use SQL Server for my database needs. Most of my tables have fewer than 1,000 records. I haven&#039t had any trouble retrieving and updating records to date. However, one table in this database seems to be giving me some trouble now. It responds very slowly to any hits. It only has 400 records and maybe 15 fields. The query I use to get a recordset couldn&#039t be simpler: "SELECT * FROM table". Since the way I connect is the same as with any other in the db, I&#039m wondering what some typical reasons for a slow response are. I do have a primary key and data types are either int or varchar.<BR><BR>Any thoughts?<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: very general performance question

    Well, SELECT * isn&#039t the most efficient. Try listing the fields explicitly.<BR><BR>Dunc

  3. #3
    PJ Guest

    Default RE: very general performance question

    I understand that and I wouldn&#039t do that with a large table or one with fields I don&#039t use explicitly, but I also use "SELECT *" from these other tables without incident because I really use all of the fields except for the id. Since there are a similar number of fields in each table, I was wondering what things an experienced person would think to check into to figure out why one table in particular would respond much slower than the others. <BR><BR>Ane new thoughts?

  4. #4
    Garth Guest

    Default RE: very general performance question

    Very strange...SQL Server can retrieve 400 rows of data in a 15 column table almost instaneously. How fast does the SELECT run when you execute it in Query Analyzer? If it runs quickly in Query Analyzer the problem is with the client-side code. If it does not run quickly in Query Analyzer execute a DBCC CHECKTABLE to see if there are any internal problems.<BR><BR>Garth<BR><BR>

  5. #5
    PJ Guest

    Default RE: very general performance question

    You know. That&#039s a good point. It ran lightning fast in Query Analyzer. I will have to really scour my code. It&#039s VBScript, so client-side may not be the real issue, but looking at it more closely may reveal something I didn&#039t notice before. <BR><BR>One thing about this recordset that IS a little different than the others is that I&#039m looping to dynamically build a list. I&#039m certain that that&#039s the hang-up because when I limit the search to a single record, it comes right up. When I open it to all the records (600 actually), it&#039s very sluggish.<BR><BR>I wonder the problem could be there. Such loops are very routine. Do you have any ideas there?<BR><BR>Thanks for the idea to check the speed in the Query Analyzer. It never occurred to me to ever do that, so I will use that for testing with future apps, I&#039m sure.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts