1

I want to store the spreadsheet data in database, so right now i am using key/value pattern to store the same but its taking too much time to retrieve it from data base, if the data is huge. Do anyone has the best way to do the same. How Google saves their spreadsheet data?

Usually I have to show 30 to 40 columns and 10,000 rows on the web page with page size 500 or 1000 for pagination. Data is for line item with pricing.

My current database structure is as below.

Column Table Column_Id int Column_Name nvarchar(50)
Column_Type nvarchar(50)

Value Content Table criteria_id int column_id int row_id int column_contents nvarchar(100)

4

3 回答 3

2

A naive schema for storing a spreadsheet:

create table spreadsheet
(
id INTEGER primary key,
name TEXT UNIQUE not null
);

create table cell
(
id INTEGER primary key,
spreadsheet_id INTEGER NOT NULL REFERENCES spreadsheet(id),
row INTEGER not null,
col INTEGER not null,
content TEXT NOT NULL
);
于 2009-06-15T21:18:13.727 回答
0

如果您只是加载和保存它,而不是查询太多,我建议为整个工作表或每一页或至少每一行使用一个 XML 字段。

我的另一个问题是,你如何查询这个来填充你的工作表?您是否使用循环并为每一行或每一列打开单独的查询?

您的设计可能不是最理想的,但它实际上应该对您描述的数据集表现不错,恕我直言。

于 2009-06-16T17:12:35.517 回答
0

考虑到 Excel 被广泛认为是数据库的默认工具,我不确定存储在电子表格中的数据类型除了它是一个表并且行数有限制之外,还有什么其他的东西。

除了“决定结构的是数据,而不是来源”之外,我认为没有足够的区别来说明其他任何事情。

于 2009-06-16T17:16:23.797 回答