Solved

Accessing Cygnet oil/gas data from Access or SQL Server

Posted on 2013-10-30
4
747 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 (Access MVP)
  • 2
  • 2
4 Comments
 
LVL 35

Assisted Solution

by:David Todd
David Todd earned 500 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 47

Author Comment

by:Dale Fye (Access MVP)
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 500 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 47

Author Closing Comment

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now