statistics.sql 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. --
  2. -- structure for table `alarm_data`
  3. --
  4. DROP TABLE IF EXISTS alarm_data;
  5. CREATE TABLE IF NOT EXISTS `alarm_data` (
  6. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  7. `create_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  8. `type` varchar(50) NOT NULL DEFAULT '',
  9. `total` int(20) NOT NULL,
  10. `source_ip` varchar(150) NOT NULL DEFAULT '0.0.0.0',
  11. `description` varchar(256) NOT NULL,
  12. `status` int(1) NOT NULL DEFAULT '1',
  13. PRIMARY KEY (`id`),
  14. KEY `to_date` (`create_date`),
  15. KEY `method` (`type`)
  16. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  17. -- --------------------------------------------------------
  18. --
  19. -- Table structure for table `alarm_data_mem`
  20. --
  21. DROP TABLE IF EXISTS alarm_data_mem;
  22. CREATE TABLE IF NOT EXISTS `alarm_data_mem` (
  23. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  24. `create_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  25. `type` varchar(50) NOT NULL DEFAULT '',
  26. `total` int(20) NOT NULL,
  27. `source_ip` varchar(150) NOT NULL DEFAULT '0.0.0.0',
  28. `description` varchar(256) NOT NULL,
  29. `status` int(1) NOT NULL DEFAULT '1',
  30. PRIMARY KEY (`id`),
  31. UNIQUE KEY `type` (`type`,`source_ip`),
  32. KEY `to_date` (`create_date`),
  33. KEY `method` (`type`)
  34. ) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  35. -- --------------------------------------------------------
  36. --
  37. -- Table structure for table `stats_data`
  38. --
  39. DROP TABLE IF EXISTS stats_data;
  40. CREATE TABLE IF NOT EXISTS `stats_data` (
  41. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  42. `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  43. `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  44. `type` varchar(50) NOT NULL DEFAULT '',
  45. `total` int(20) NOT NULL,
  46. PRIMARY KEY (`id`),
  47. KEY `from_date` (`from_date`),
  48. KEY `to_date` (`to_date`),
  49. KEY `method` (`type`)
  50. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  51. -- --------------------------------------------------------
  52. --
  53. -- Table structure for table `stats_ip`
  54. --
  55. DROP TABLE IF EXISTS stats_ip;
  56. CREATE TABLE IF NOT EXISTS `stats_ip` (
  57. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  58. `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  59. `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  60. `method` varchar(50) NOT NULL DEFAULT '',
  61. `source_ip` varchar(255) NOT NULL DEFAULT '0.0.0.0',
  62. `total` int(20) NOT NULL,
  63. PRIMARY KEY (`id`),
  64. UNIQUE KEY `datemethod` (`to_date`,`method`,`source_ip`),
  65. KEY `from_date` (`from_date`),
  66. KEY `to_date` (`to_date`),
  67. KEY `method` (`method`)
  68. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  69. -- --------------------------------------------------------
  70. --
  71. -- Table structure for table `stats_ip_mem`
  72. --
  73. DROP TABLE IF EXISTS stats_ip_mem;
  74. CREATE TABLE IF NOT EXISTS `stats_ip_mem` (
  75. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  76. `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  77. `method` varchar(50) NOT NULL DEFAULT '',
  78. `source_ip` varchar(255) NOT NULL DEFAULT '0.0.0.0',
  79. `total` int(20) NOT NULL,
  80. PRIMARY KEY (`id`),
  81. UNIQUE KEY `datemethod` (`method`,`source_ip`)
  82. ) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  83. -- --------------------------------------------------------
  84. --
  85. -- Table structure for table `stats_method`
  86. --
  87. DROP TABLE IF EXISTS stats_method;
  88. CREATE TABLE IF NOT EXISTS `stats_method` (
  89. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  90. `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  91. `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  92. `method` varchar(50) NOT NULL DEFAULT '',
  93. `auth` tinyint(1) NOT NULL DEFAULT '0',
  94. `cseq` varchar(100) NOT NULL,
  95. `totag` tinyint(1) NOT NULL,
  96. `total` int(20) NOT NULL,
  97. PRIMARY KEY (`id`),
  98. UNIQUE KEY `datemethod` (`to_date`,`method`,`auth`,`totag`,`cseq`),
  99. KEY `from_date` (`from_date`),
  100. KEY `to_date` (`to_date`),
  101. KEY `method` (`method`),
  102. KEY `completed` (`cseq`)
  103. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  104. -- --------------------------------------------------------
  105. --
  106. -- Table structure for table `stats_method_mem`
  107. --
  108. DROP TABLE IF EXISTS stats_method_mem;
  109. CREATE TABLE IF NOT EXISTS `stats_method_mem` (
  110. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  111. `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  112. `method` varchar(50) NOT NULL DEFAULT '',
  113. `auth` tinyint(1) NOT NULL DEFAULT '0',
  114. `cseq` varchar(100) NOT NULL,
  115. `totag` tinyint(1) NOT NULL,
  116. `total` int(20) NOT NULL,
  117. PRIMARY KEY (`id`),
  118. UNIQUE KEY `datemethod` (`method`,`auth`,`totag`, `cseq`),
  119. KEY `from_date` (`create_date`),
  120. KEY `method` (`method`),
  121. KEY `completed` (`cseq`)
  122. ) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  123. -- --------------------------------------------------------
  124. --
  125. -- Table structure for table `stats_useragent`
  126. --
  127. DROP TABLE IF EXISTS stats_useragent;
  128. CREATE TABLE IF NOT EXISTS `stats_useragent` (
  129. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  130. `from_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  131. `to_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  132. `useragent` varchar(100) NOT NULL DEFAULT '',
  133. `method` varchar(50) NOT NULL DEFAULT '',
  134. `total` int(10) NOT NULL DEFAULT '0',
  135. PRIMARY KEY (`id`),
  136. UNIQUE KEY `datemethodua` (`to_date`,`method`,`useragent`),
  137. KEY `from_date` (`from_date`),
  138. KEY `to_date` (`to_date`),
  139. KEY `useragent` (`useragent`),
  140. KEY `method` (`method`),
  141. KEY `total` (`total`)
  142. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  143. -- --------------------------------------------------------
  144. --
  145. -- Table structure for table `stats_useragent_mem`
  146. --
  147. DROP TABLE IF EXISTS stats_useragent_mem;
  148. CREATE TABLE IF NOT EXISTS `stats_useragent_mem` (
  149. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  150. `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  151. `useragent` varchar(100) NOT NULL DEFAULT '',
  152. `method` varchar(50) NOT NULL DEFAULT '',
  153. `total` int(10) NOT NULL DEFAULT '0',
  154. PRIMARY KEY (`id`),
  155. UNIQUE KEY `useragent` (`useragent`,`method`)
  156. ) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;