query optimization

Posted on 2011-10-07
Last Modified: 2012-06-27
Hello experts,

I am using the access database. I have one table with 20,000 records and when i am using the query select * from tablename from .aspx page with C# then system is taking too long to execute the query.

What is the best possible way to fetch the records.

Any helping hands will be greatly appreciated.

Many thanks
Question by:dotsandcoms
    LVL 21

    Expert Comment

    by:Dale Burrell
    Change to SQL Server Express :)

    How long is it taking and what are you doing with the records? If you are trying to display that much data it will take a little while...
    LVL 37

    Accepted Solution

    You could either select less records by adding a WHERE clause or select less columns, only the ones you need, like this:

    select col1, col2, col4
    from tablename
    where col3 > 1000;
    LVL 4

    Expert Comment

    you can opt to use temp tables to view the data through a stored proc, check out the site below...
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    Have you tried compacting the file lately? Sometimes running an Access DB for a length of time can bloat the file and cause queries to slow.

    Author Closing Comment

    good solution

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now