开发者

Alternatives of Datatable

In my web application, I have a dynamic query that returns huge data to datatable, and this query is often recalled with different parameters. So database is exhausted.

I want to get all record with no parameters to an object, and perfor开发者_运维问答m queries (may be with linq) on this object. So database will not be exthausted.

Which objects can be used instead of datatable?


This is one of my pet peeves - people who return all the data from the database.

There is absolutely no need for this unless you are doing reporting.

If you are doing reporting, then you need to increase your hardware capability so that the database can cope. This may also include tuning your database, rearranging tables, reindexing, regular rebuilding of indexes, updating statistics, archiving out old data, etc.

If you are NOT doing reporting, then start limiting how much data can be queried at any one time. Users DO NOT need to see massive quantities of data all at once. They need to see discrete amounts of data presented in a manageable and coherent way.

Another rule of thumb i like to observe is: let your database server do the work, it is made to manipulate lots of data, it is what it is good at, and it should have the power to do it. Pulling back loads of data to the client, and then trying to manipulate that data on the client is a foolish thing to do. If your client machines are more powerful than the database server then you have issues.


Never ever perform this(except cache)!!!

You are trying to implement DB mechanisms, like

  • persistent storage
  • index search and query strategy
  • replication
  • and so on

Spend your time on db optimization(optimal scheme, indexes, query, partitioning).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜