Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Accessing Cygnet oil/gas data from Access or SQL Server

Posted on 2013-10-30
4
Medium Priority
?
842 Views
Last Modified: 2013-11-09
A client recently purchased some oil/gas wells that use Cygnet as their production data collection and reporting system.  However, they have other wells that use other production data which we pull into SQL Server for use by their Business Intelligence software.

I've been looking at the Cygnet data for the last several nights and believe that the HistoricalValues table contains the data that I need to pull into SQL Server.  Historically, I've used Access to pull the data from different data sources, massage it, and populate the SQL tables.  However the data structure of this "HistoricalValues" table makes the number of records massive (I still don't know how massive because every time I try to count the records with the table linked to Access, the query locks up).  I speculate that the table contains well over 50 million records (500 wells, 50 Record Types, 365 days, 5+ years).

The structure of this table looks something like:

WellID  - String (50)
ReadingDate - Date
RecordType - String (50)  - there appear to be about 75 record types
Value - String (50) - even numeric values are stored as strings
many more Yes/No fields, but these are the critical fields.

Rather than creating multiple tables for specific types of data and storing that data in multiple columns, this table is structured with a primary key that looks like:

WellID + ReadingDate + RecordType

I have attempted to access this data in a variety of methods from Access and have set the timeouts of the queries to zero, but every query other than SELECT TOP 100 records has taken over a half hour to execute in Access.

Does anyone have any experience working with Cygnet data?  I there a way that I can link the Cygnet data to SQL Server (linked server or something?) that will allow me to use the processing power of SQL Server to extract the necessary data from this table?
0
Comment
Question by:Dale Fye
  • 2
  • 2
4 Comments
 
LVL 35

Assisted Solution

by:David Todd
David Todd earned 2000 total points
ID: 39613500
Hi,

While that type of table has its appeal, as you've discovered, performance isn't great.

The problem is that say you want all the OilPressure Type readings - there is now way to create indexes that sensibly know about this. Why better to add a table for each type of reading.

The other thing, is that this supposes that all kinds of readings can be fully encapsulated by a ... and hear starts the discussion: Will a float do, or do you need a double? How do you range check this for sensibleness? ie temperature ranges from 0 to a couple of thousand kelvin as a max. A temperature reading of a million in any scale has almost got to be wrong!, Whereas pressure in MegaPascals is quite reasonable.

HTH
  David

PS Store numerical data as numeric data, and not as strings! That will use the processing power of SQL to extract the data. Otherwise you are shackling SQL by having to convert from strings to numbers to do things intelligently like find sum and average.
0
 
LVL 49

Author Comment

by:Dale Fye
ID: 39613896
David,

You obviously have some experience in the oil/gas industry.  Your advice is solid, but what I'm really looking for is someone with experience with the Cygnet database.  These guys are supposedly one of the big dogs in oil/gas industry, but this is a terrible data structure for a "big dog".
0
 
LVL 35

Accepted Solution

by:
David Todd earned 2000 total points
ID: 39614945
Hi,

I don't have any experience with oil/gas, but recognise the pattern you propose, known as attribute/key/value.

Here is one thought for performance once you get the data into SQL - you could try some indexed views. That is, if you want all the temperature readings then create a view and then create indexes on that view.

http://technet.microsoft.com/en-us/library/dd171921(v=sql.100).aspx

The other thought is that the newer sqls have filtered indexes, which may be able to do the same thing for you.

HTH
  David
0
 
LVL 49

Author Closing Comment

by:Dale Fye
ID: 39636110
Thanks for your help David.  Didn't solve the problem but did point me towards some options.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question