473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to store big Arrays

jc
Hi.
I am in a situation with an engineering application involving
monitoring of press operations. This involves storage of numbers for
both an X and Y arrays. The number of element within the arrays
varies slightly but should be identical for a singular press
operation.

One approach is to store an element in a row. This would be 6000 rows
(3000 elements/axis * 2). This seems excessive for a single
operation. Also, I have no intention of every reading rows that would
be a subset of an operation.

The other approach is to pack an array of data into a single varbinary
data type.

Questions;
1) Is my thinking here correct for DB usage?
2) Can people provide some techniques for doing the later (an array
into a single varbinary value)?

In particular for point 2 how would I cast arrays that vary from
2500 .. 3500 elements with integers to a single varbinary and of
course retrieve?

Regards JC.......

Oct 24 '08 #1
5 4047
On Thu, 23 Oct 2008 19:21:21 -0700 (PDT), jc <ji**********@gm.com>
wrote:

I haven't used them yet, but SQL 2008 has support for spatial data
types.

-Tom.
Microsoft Access MVP

>Hi.
I am in a situation with an engineering application involving
monitoring of press operations. This involves storage of numbers for
both an X and Y arrays. The number of element within the arrays
varies slightly but should be identical for a singular press
operation.

One approach is to store an element in a row. This would be 6000 rows
(3000 elements/axis * 2). This seems excessive for a single
operation. Also, I have no intention of every reading rows that would
be a subset of an operation.

The other approach is to pack an array of data into a single varbinary
data type.

Questions;
1) Is my thinking here correct for DB usage?
2) Can people provide some techniques for doing the later (an array
into a single varbinary value)?

In particular for point 2 how would I cast arrays that vary from
2500 .. 3500 elements with integers to a single varbinary and of
course retrieve?

Regards JC.......
Oct 24 '08 #2
On Thu, 23 Oct 2008 19:26:52 -0700, Tom van Stiphout
<to*************@cox.netwrote:
>On Thu, 23 Oct 2008 19:21:21 -0700 (PDT), jc <ji**********@gm.com>
wrote:

I haven't used them yet, but SQL 2008 has support for spatial data
types.
I think you meant sparse arrays. It wasn't clear to me that the
arrays in this case were going to be sparse.

Roy Harvey
Beacon Falls, CT
Oct 24 '08 #3
On Fri, 24 Oct 2008 07:29:37 -0400, "Roy Harvey (SQL Server MVP)"
<ro********@snet.netwrote:

No, I meant spatial data:
http://msdn.microsoft.com/en-us/library/bb964711.aspx

-Tom.

>On Thu, 23 Oct 2008 19:26:52 -0700, Tom van Stiphout
<to*************@cox.netwrote:
>>On Thu, 23 Oct 2008 19:21:21 -0700 (PDT), jc <ji**********@gm.com>
wrote:

I haven't used them yet, but SQL 2008 has support for spatial data
types.

I think you meant sparse arrays. It wasn't clear to me that the
arrays in this case were going to be sparse.

Roy Harvey
Beacon Falls, CT
Oct 24 '08 #4
On Fri, 24 Oct 2008 05:55:41 -0700, Tom van Stiphout
<to*************@cox.netwrote:
>No, I meant spatial data:
http://msdn.microsoft.com/en-us/library/bb964711.aspx
So you are thinking the X by Y array is representing spacial
coordinates. Possible, I guess, but I tend to think of spacial data
as the data itself being the location, while with an array I think of
the subscript (x,y) representing the location. But then I have not
worked with the new spatial support.

Roy Harvey
Beacon Falls, CT
Oct 24 '08 #5
jc (ji**********@gm.com) writes:
I am in a situation with an engineering application involving
monitoring of press operations. This involves storage of numbers for
both an X and Y arrays. The number of element within the arrays
varies slightly but should be identical for a singular press
operation.

One approach is to store an element in a row. This would be 6000 rows
(3000 elements/axis * 2). This seems excessive for a single
operation. Also, I have no intention of every reading rows that would
be a subset of an operation.

The other approach is to pack an array of data into a single varbinary
data type.
The latter sounds like a repeating group to me, and that is usually
a gross violation of the fundamentals of a relational database.

However, in the end, it boils down to what you will use this data for.
If you don't plan to use all these values in the database, but only
outside it, storing it as a blob could make sense.

But if you plan to analyse it to find max, mins, average and so on,
storing it in a normalised data model is the way to go.
2) Can people provide some techniques for doing the later (an array
into a single varbinary value)?
Again that depends on how the values would enter the database. It
sounds to me that the easiest would be if the client composed the
binary arrays.
In particular for point 2 how would I cast arrays that vary from
2500 .. 3500 elements with integers to a single varbinary and of
course retrieve?
In which layer? In SQL Server you would have to write a user-defined
aggregate to build the varbinary(MAX). In SQL 2005 you would have to
workaround the restriction that a UDA cannot return more than 8000
bytes.

As for retrieving, look at fixbinary_single:
http://www.sommarskog.se/arrays-in-s...l#fixed-length

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Oct 24 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: arkobose | last post by:
my earlier post titled: "How to input strings of any lengths into arrays of type: char *array ?" seems to have created a confusion. therefore i paraphrase my problem below. consider the...
4
by: RubenDV | last post by:
I am trying to make a cipher with a 256-bit key but i have no idea how the store this key without using arrays of ints or something like that. I just need a type that is big enough to hold the...
0
by: John Salerno | last post by:
Ok, here's a diagram of the puzzle situation I was talking about before: http://www.johnjsal.com/program1/switches.jpg Now, one "switch" is two of those small columns of 10 boxes each (so there...
4
by: Robert P. | last post by:
I can easily store a one-dimensional array in viewstate ( see Test1 ) If I try storing a multi-dimensional array in the viewstate it's crapping out on me when it goes to serialize the array (not...
5
by: Michal Táborský | last post by:
I am wondering, if it's effective to use text arrays to store multilanguage information. We used to do it like this: CREATE TABLE product ( id serial NOT NULL, price float4, ... )
7
by: rhitz1218 | last post by:
Hi all: Is it possible to store an integer array to another integer array? Or should I use an array of pointers that will point to a particular array? Thanks for the help.
1
by: gdarian216 | last post by:
I am trying to read in inputs from a file to my program. I have declared a struct that holds a string and some arrays. struct records { string name; float quizzes; ...
3
by: thegreatest21 | last post by:
I posted this before and it was not clear so I am posting this again as I need help. And I have turned to thescripts because I have tried all the tutorials on Arrays/ArrayList and have just been even...
0
bilibytes
by: bilibytes | last post by:
Hi, i am trying to figure out how to store a friend relation beetween my users. 1. I thought about using arrays, store for each user an array containing all its friends. But i don't know if...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.