Version users: 7.91. TLS, Oracle DB 12c, Project language: Java
Problem:
2020.02.04 00:44:30 INFO ce[AXANL9Ra5o4T8yCI4Qgd][o.s.c.t.s.ComputationStepExecutor] Persist live measures | insertsOrUpdates=929488 | status=SUCCESS | time=1763834ms
With Loglevel: TRACE, I found a lot of upsert operations:
2020.02.04 14:59:38 TRACE ce[AXAQf7pzLAY_plPjlUe9][sql] time=1ms | sql=delete from live_measures where component_uuid = ? and metric_id not in ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) | params=4270d582-341b-4c13-b630-caef1b403bb4, 206, 88, 184, 210, 80, 308, 190, 36, 83, 183, 231, 40, 14, 89, 41, 176, 235, 115, 39, 23, 71, 20, 5, 9, 194, 12, 82, 207, 191, 79, 38, 182, 84, 3, 43, 197, 310, 204, 173, 1, 42, 175, 288, 189, 202, 199, 179, 15, 78, 229, 228, 48, 185, 211, 196, 192, 72, 87, 86, 205, 309, 233, 6, 198, 193, 230, 174, 201, 208, 188, 74, 200, 37, 195, 181, 81, 232, 73, 85, 234, 46, 209
2020.02.04 14:59:38 TRACE ce[AXAQf7pzLAY_plPjlUe9][sql] time=2ms | sql=update live_measures set value = ?, variation = ?, text_value = ?, measure_data = ?, updated_at = ? where component_uuid = ? and metric_id = ? | params=8, 0.0, 12, -2, 1580824778269, 3a40796a-b67d-4745-ae4e-22cf237e157c, 206
The current size of the table live_measures ist about 2 million recoreds, one big project has about 900k records.
And I found out, the column “measure_data” is with type blob and Oracle will created automatically an index for this column. In my opionion, for a huge, frequently updated table, it is better not created an index on the frequently changed column.
Here is my questions:
- Does anybody has experiences with a huge table live_measures, as the one I have? What DB should be used in thise case? PostgreSQL? or Oracle?
- Is it possible to disable the index on the column measure_data for the table live_measures? For Oracle and for PostgreSQL?
- I found the table “projects” was also very huge. Each Java Class has a record in this table. Does it means, each java class is an internal project? It should be a wrong design or abused concept! In the new code, the db schema has a big change, compaired with the one in the version 7.9.1.
All in all, I have a very old project, which has 900k recoreds in table live_measures, and each update takes about 1-2 ms; altogether takes about 15-30 minutes. I need to make it faster.
Dear Sonarsource Community, please help me! Thanks in advance!
Best regards
Hongfu Huang from Swizterland