【发布时间】:2011-01-01 11:43:37
【问题描述】:
我正在使用 PostgreSQL。
我意识到 PostgreSQL 有 Array 数据类型。
http://www.postgresql.org/docs/8.1/interactive/arrays.html
目前,我需要使用数据库来存储半导体工厂的测量结果。
他们正在生产半导体单元。每个半导体单元可以有可变数量的测量参数。
我打算按以下方式设计表格。
SemicondutorComponent
=====================
ID |
Measurement
=================
ID | Name | Value | SemicondutorComponent_ID
数据示例:
SemicondutorComponent
=====================
1 |
2 |
Measurement
=================
1 | Width | 0.001 | 1
2 | Height | 0.021 | 1
3 | Thickness | 0.022 | 1
4 | Pad0_Length | 0.031 | 1
5 | Pad1_Width | 0.041 | 1
6 | Width | 0.001 | 2
7 | Height | 0.021 | 2
8 | Thickness | 0.022 | 2
9 | Pad0_Length | 0.031 | 2
10| Pad1_Width | 0.041 | 2
11| Pad2_Width | 0.041 | 2
12| Lead0_Width | 0.041 | 2
假设一家工厂在 1 天内生产 2400 万件产品
SemicondutorComponent 表在 1 天内将有 2400 万行
假设一个 SemicondutorComponent 单元有 50 个测量参数。 (可以更多也可以更少,取决于 SemicondutorComponent 类型)
测量表在 1 天内将有 24 * 5000 万行
这样设计效率高吗?
我希望有超快的写入速度,以及合理的从数据库读取速度。
或者我应该使用 PostgreSQL 数组工具吗?
SemicondutorComponent
=====================
ID | Array_of_measurement_name | Array_of_measurement_value
【问题讨论】:
-
所以你的问题不是关于数组,而是更笼统:archives.postgresql.org/message-id/…
-
不!这是完全不同的问题。
标签: database-design postgresql