0

I'm trying to export large excel files from database (client request). I currently use two selects to get data from two tables and store them in two sqldatasets. I have a delay before the file starts uploading since each table gives up to 100k rows.

I've turned off the outputbuffer in the httphandler, and I export each row from the first table as its' own vb.net html table (with dependent rows from the second dataset). Once the upload begins, it's very fast, but client still wants to get rid of that delay.

I was thinking I could break up the two large selects into many small selects to use as I build the html tables, opening and closing each connection.

Can sql server handle it?

What are the downsides?

I've looked everywhere and can find nothing. Many thanks in advance!

Limitations

The second table is dependent upon the first table, so I can either hit it once for everything and loop or many time for each row of the first table...right?...

4

1 回答 1

0

忽略我之前的回答。我很困惑。

我在这里看到两种可能性:

  1. 你的查询很慢。
  2. 您正在将查询结果转换为内存中的集合(人们通常会.ToList()在他们完全不需要的地方做)。

在这两种情况下,我们都需要查看您的代码。我可以告诉您的一件事是,将查询拆分为子集查询可能会减慢您的速度。

于 2012-12-17T16:06:41.783 回答