提高Jira Oracle查询性能
我们有一个将jira数据导入oracle数据库以进行报告的过程。我目前面临的问题是在oracle中提取自定义字段并将行转换为列 这就是我提取查询的方式,这里的问题是性能无法扩展提高Jira Oracle查询性能,oracle,jira,Oracle,Jira,我们有一个将jira数据导入oracle数据库以进行报告的过程。我目前面临的问题是在oracle中提取自定义字段并将行转换为列 这就是我提取查询的方式,这里的问题是性能无法扩展 select A.*, (select cf.date_value from v_jira_custom_fields cf where cf.issue_id = a.issue_id and cf.custom_field_name = 'Start Date') Start_Date, (select cf.n
select A.*, (select cf.date_value from v_jira_custom_fields cf where cf.issue_id = a.issue_id and cf.custom_field_name = 'Start Date') Start_Date,
(select cf.number_value from v_jira_custom_fields cf where cf.issue_id = a.issue_id and cf.custom_field_name = 'Story Points') Story_Points,
(select cf.custom_value from v_jira_custom_fields cf where cf.issue_id = a.issue_id and cf.custom_field_name = 'Ready') Ready
from jira_data A
where A.project = 'DAK'
and A.issue_id = 2222
要真正了解瓶颈在哪里,我们至少需要获得一个执行计划和关于现有索引的信息 假设两个表中的
issue\u id
和project
都有索引,我下一步尝试的是去掉3个单独的选择,并将jira\u数据连接到数据透视的jira\u自定义\u字段
with P as (
select
project
, issue_id
, story_type_s
, impacted_application_s
, impacted_application_c
, story_points_n
, start_date_d
, end_date_d
, ready_c
from v_jira_custom_fields
pivot (
max(string_value) as s
, max(number_value) as n
, max(text_value) as t
, max(date_value) as d
, max(custom_value) as c
for customfield_id in (
1 story_type
, 2 impacted_application
, 3 story_points
, 4 start_date
, 5 end_date
, 6 ready
)
)
)
select
A.*
, P.start_date_d start_date
, P.story_points_n story_points
, P.ready_c ready
from jira_data A
join P on A.project = P.project and A.issue_id = P.issue_id
where A.project = 'DAK'
and A.issue_id = 2222
请重新阅读问题,并重申您几乎没有提供任何信息来获得帮助。你没有提到你的源数据库,是MySQL还是Oracle?请参阅您应提供的有关Oracle的最低限度信息。没有它,您只能得到一个安全的建议:“使用绑定变量!”