Table Design Consideration [message #616834] |
Sat, 21 June 2014 05:20 |
|
VIP2013
Messages: 91 Registered: June 2013
|
Member |
|
|
I am using version of oracle
I am having a requirement for which i have to design the tables structures which will best suits current design need and considering future data growth.. etc
We are planning to store possible performance metrics for application data, which will help in analysing the future trend and take necessary action, and we should be able to easily extract report out of this repository. data collection frequency will by once daily.
--We are planning all to store in a new schema(lets say perf_schema) in existing prod DB .
--Will create procedure which will basically 'INSERT INTO PERF_SCHEMA.TABLE .... SELECT FROM TRANSACTION_TABLE...WHERE..' for each of the metric.
--Performance metrics might be like 1)no Of user logins 2)No Of transactions done by ach user for that day 3)total accounts 4)total organisation.. etc ,currently we dont have all the metrics in place(some might be like , their value will not be in number datatype and we may store someother values) but we will keep on adding them as and when they will be established to be required metric, and expecting the design to be supportive.
-- So i am planning to create two table
Table "METRIC_DESC" which will store 1)metric_name VARCHAR type 2)its description VARCHAR type
Table "METRIC_DATA" which will have two columns 1)Create_date Timestamp 2)METRIC_NAME VARCHAR column 3) VALUE VARCHAR Type, it will be of VARCHAR type and can store any type of data(NUMBER/VARCHAR.. etc), but i am bit worried if during fetching values and putting 'like' clause on this column will impact the performance.
Table will be list partitioned on METRIC_NAME and Interval partitioned on Create_date. Global index on METRIC_NAME and Local Index on create_date.
Currently no such scenario, but i am thinking if ther will be any subcategorization of Metric_name reuired in future also those will be part of METRIC_DESC table, which will not be bulky.
I neeed expert advice, if it is fine, considering above requirement or is there some other better approach for this? I dont know if materialized view suits this scenario..
[Updated on: Sat, 21 June 2014 05:21] Report message to a moderator
|
|
|
|
Re: Table Design Consideration [message #616850 is a reply to message #616834] |
Sat, 21 June 2014 10:37 |
John Watson
Messages: 8931 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
I see that you have also raised this question here, https://community.oracle.com/thread/3575316
My standard advice to clients on partitioning is: "Don't use partitioning because you can. Get it right, and it may be good; get it wrong, and it will be disastrous. You need a precise business problem, and you must prove mathematically that your chosen partitioning strategy will fix that problem, and not cause any others."
You do not appear to have identified any problems, and have given no reasons for selecting your chosen partitioning strategy. You do need to do this. I have seen awful situations caused by using partitioning inappropriately.
|
|
|
Re: Table Design Consideration [message #616855 is a reply to message #616834] |
Sat, 21 June 2014 11:37 |
|
VIP2013
Messages: 91 Registered: June 2013
|
Member |
|
|
@Blackswan, Yes my mistake, its three columns for that table METRIC_DATA. Also i think you are referring to the AWR tables for fetching DB performance data,but i already have those getting stored for ~6months in my Prod DB itself(through retention period setup), so i dont need those to be exported to any other schema. What i want is to store application metric data, like DB users logon can not be directly related to the application users those are actual clients hitting our system.
@John, thanks, yes for the time being i wil not consider the partitioning starategy, i was thiking of a design which will also cater the future partitioning strategy if we require. Can you please help me to validate the design strategy for the above mentioned scenario? Is it ok, or some other approach wil be better?
[Updated on: Sat, 21 June 2014 11:38] Report message to a moderator
|
|
|
|
Re: Table Design Consideration [message #616858 is a reply to message #616856] |
Sat, 21 June 2014 12:06 |
|
VIP2013
Messages: 91 Registered: June 2013
|
Member |
|
|
I mean to say, we have the transaction tables currently holding the functional data, like one of the table store all the transaction along with their details in the functional schema. But as a performance team perspective, we need basic info like count of total transactions for a day(or some SLA metrics which actually matters to client), at each day end it should get flushed out to another table, so that we can plot a trend and can understand what is the growth trend and how to cater that in future(or if SLA is breaching). So that we dont hit the transaction table each time for the reporting purpose and can use the capacity repository with all the main metrics, which really matters to client. Also we will keep these Metric data for years even if the transactional details might get purged..
[Updated on: Sat, 21 June 2014 12:08] Report message to a moderator
|
|
|
|
Re: Table Design Consideration [message #616861 is a reply to message #616859] |
Sat, 21 June 2014 12:37 |
|
VIP2013
Messages: 91 Registered: June 2013
|
Member |
|
|
Thanks for your prompt response. Actually for the time being i am not worried about the source tables/transaction tables and their details as the functional guys will provide queries to fetch/pull the business metrics data ot of that. i only need to think of the target table/tables design, which will hold these metrics.
[Updated on: Sat, 21 June 2014 12:38] Report message to a moderator
|
|
|
|
Re: Table Design Consideration [message #616863 is a reply to message #616862] |
Sat, 21 June 2014 12:58 |
|
VIP2013
Messages: 91 Registered: June 2013
|
Member |
|
|
you are right, total metrics can be captured in daily basis through this but if it comes to user level, then perhaps i have to name the metrics that much time as much no of users. Like user1_transaction,user2_transaction.. etc and store the value against that.Just to fit into the design, or is there some other technique?
[Updated on: Sat, 21 June 2014 13:01] Report message to a moderator
|
|
|
|
|
|
Re: Table Design Consideration [message #616871 is a reply to message #616868] |
Sat, 21 June 2014 14:48 |
|
VIP2013
Messages: 91 Registered: June 2013
|
Member |
|
|
Thanks. Noted.
So for a particular metric the VALUE column will be either NUMBER or VARCHAR or DATE.. etc. In that case i will make sure, to use to_number,to_date functions properly during using comparison operator and it will be metric specific.So perhaps single VALUE column will suffice.
[Updated on: Sat, 21 June 2014 14:49] Report message to a moderator
|
|
|
|
|
|
Re: Table Design Consideration [message #616875 is a reply to message #616874] |
Sat, 21 June 2014 15:29 |
|
VIP2013
Messages: 91 Registered: June 2013
|
Member |
|
|
Thats why i mentioned , will make sure such queries will be asociated with additional METRIC_NAME filter so this situation will not arise. Again the value column will be mostly in SELECT clause only , but not in WHERE clause. Date and metric_name will be in the WHERE clause only.
|
|
|