Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6105791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:00:33+00:00 2026-05-23T14:00:33+00:00

I have some tables in a MySQL database to represent records from a sensor.

  • 0

I have some tables in a MySQL database to represent records from a sensor. One of the features of the system I’m developing is to display this records from the database to the web user, so I used ADO.NET Entity Data Model to create an ORM, used Linq to SQL to get the data from the database, and stored them in a ViewModel I designed, so I can display it using MVCContrib Grid Helper:

public IQueryable<TrendSignalRecord> GetTrends()
{
    var dataContext = new SmgerEntities();
    var trendSignalRecords = from e in dataContext.TrendSignalRecords
                select e;

    return trendSignalRecords;
}

public IQueryable<TrendRecordViewModel> GetTrendsProjected()
{
    var projectedTrendRecords = from t in GetTrends()
    select new TrendRecordViewModel
    {
        TrendID = t.ID,
    TrendName = t.TrendSignalSetting.Name,
    GeneratingUnitID = t.TrendSignalSetting.TrendSetting.GeneratingUnit_ID,
    //{...}
    Unit = t.TrendSignalSetting.Unit
    };
    return projectedTrendRecords;
}

I call the GetTrendsProjectedMethod and then I use Linq to SQL to select only the records I want. It is working fine in my developing scenario, but when I test it in a real scenario, where the number of records is way greater (something around a million records), it stops working.

I put some debug messages to test it, and everything works fine, but when it reaches the return View() statement, it simply stops, throwing me a MySQLException: Timeout expired. That let me wondering if the data I sent to the page is retrieved by the page itself (it only search for the displayed items in the database when the page itself needs it, or something like that).

All of my other pages use the same set of tools: MVCContrib Grid Helper, ADO.NET, Linq to SQL, MySQL, and everything else works alright.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:00:34+00:00Added an answer on May 23, 2026 at 2:00 pm

    You absolutely should paginate your data set before executing your query if you have millions of records. This could be done using the .Skip and .Take extension methods. And those should be called before running any query against your database.

    Trying to fetch millions of records from a database without pagination would very likely cause a timeout at best.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mysql database with a variety of different tables with some storing
I have some tables that represent various types. They usually just consist of an
I have a huge database with some 100 tables and some 250 stored procedures.
I have a Linux web server and I'd like to make some database tables
I have two tables in my database schema that represent an entity having a
I have been researching audit triggers for some of my sql tables. I came
I have some tables that I build as a part of my report rollup.
I have some nested tables that I want to hide/show upon a click on
I'm looking at building a Rails application which will have some pretty large tables
I basically created some tables to play around with: I have Two main tables,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.