Skip to content

Commit

Permalink
Update Rails and dependencies
Browse files Browse the repository at this point in the history
Remove underscore from dragnet selection headers
  • Loading branch information
rammpeter committed Aug 29, 2023
1 parent d822ae7 commit d843a6b
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 113 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ruby '3.1.4'
# Alternative instead of complete rails including actioncable etc., prev. version was 6.0.4
# rails_version = "7.0.0" # requires ruby >= 2.7.0 but jRuby 9.3.2.0 is compatible with ruby 2.6 only
# see: https://rubygems.org/gems/rails/versions
rails_version = "6.1.7.4"
rails_version = "6.1.7.6"
# rails_version = "7.0.4"
#gem 'rails', rails_version
gem 'activerecord', rails_version
Expand Down
124 changes: 62 additions & 62 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.4)
actionpack (= 6.1.7.4)
activesupport (= 6.1.7.4)
actioncable (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.4)
actionpack (= 6.1.7.4)
activejob (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
actionmailbox (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
mail (>= 2.7.1)
actionmailer (6.1.7.4)
actionpack (= 6.1.7.4)
actionview (= 6.1.7.4)
activejob (= 6.1.7.4)
activesupport (= 6.1.7.4)
actionmailer (6.1.7.6)
actionpack (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activesupport (= 6.1.7.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.4)
actionview (= 6.1.7.4)
activesupport (= 6.1.7.4)
actionpack (6.1.7.6)
actionview (= 6.1.7.6)
activesupport (= 6.1.7.6)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.4)
actionpack (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
actiontext (6.1.7.6)
actionpack (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
nokogiri (>= 1.8.5)
actionview (6.1.7.4)
activesupport (= 6.1.7.4)
actionview (6.1.7.6)
activesupport (= 6.1.7.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.4)
activesupport (= 6.1.7.4)
activejob (6.1.7.6)
activesupport (= 6.1.7.6)
globalid (>= 0.3.6)
activemodel (6.1.7.4)
activesupport (= 6.1.7.4)
activerecord (6.1.7.4)
activemodel (= 6.1.7.4)
activesupport (= 6.1.7.4)
activemodel (6.1.7.6)
activesupport (= 6.1.7.6)
activerecord (6.1.7.6)
activemodel (= 6.1.7.6)
activesupport (= 6.1.7.6)
activerecord-nulldb-adapter (0.9.0)
activerecord (>= 5.2.0, < 7.1)
activerecord-oracle_enhanced-adapter (6.1.6)
activerecord (~> 6.1.0)
ruby-plsql (>= 0.6.0)
activestorage (6.1.7.4)
actionpack (= 6.1.7.4)
activejob (= 6.1.7.4)
activerecord (= 6.1.7.4)
activesupport (= 6.1.7.4)
activestorage (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activesupport (= 6.1.7.6)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.4)
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -123,20 +123,20 @@ GEM
rack (>= 1.2.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.4)
actioncable (= 6.1.7.4)
actionmailbox (= 6.1.7.4)
actionmailer (= 6.1.7.4)
actionpack (= 6.1.7.4)
actiontext (= 6.1.7.4)
actionview (= 6.1.7.4)
activejob (= 6.1.7.4)
activemodel (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
rails (6.1.7.6)
actioncable (= 6.1.7.6)
actionmailbox (= 6.1.7.6)
actionmailer (= 6.1.7.6)
actionpack (= 6.1.7.6)
actiontext (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activemodel (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
bundler (>= 1.15.0)
railties (= 6.1.7.4)
railties (= 6.1.7.6)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
Expand All @@ -145,9 +145,9 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (6.1.7.4)
actionpack (= 6.1.7.4)
activesupport (= 6.1.7.4)
railties (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -195,15 +195,15 @@ PLATFORMS
universal-java-19

DEPENDENCIES
actionmailer (= 6.1.7.4)
actionpack (= 6.1.7.4)
actionview (= 6.1.7.4)
activejob (= 6.1.7.4)
activemodel (= 6.1.7.4)
activerecord (= 6.1.7.4)
actionmailer (= 6.1.7.6)
actionpack (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activemodel (= 6.1.7.6)
activerecord (= 6.1.7.6)
activerecord-nulldb-adapter
activerecord-oracle_enhanced-adapter
activesupport (= 6.1.7.4)
activesupport (= 6.1.7.6)
brakeman
i18n
jarbler
Expand All @@ -213,8 +213,8 @@ DEPENDENCIES
playwright-ruby-client
puma (~> 5.0)
rack-mini-profiler (~> 2.0)
rails (= 6.1.7.4)
railties (= 6.1.7.4)
rails (= 6.1.7.6)
railties (= 6.1.7.6)
rexml
sass-rails (>= 6)
sprockets-rails
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/dragnet/dragnet_sqls_tuning_sga_pga_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def dragnet_sqls_tuning_sga_pga
GROUP BY p.Inst_ID, p.SQL_ID, p.Child_Number
HAVING
-- Ausfuehrungsplan hat genau einen Index-Zugriff ohne Filter
SUM(CASE WHEN p.Operation = 'INDEX' AND p.Options in ('RANGE SCAN', 'UNIQUE SCAN')
SUM(CASE WHEN p.Operation = 'INDEX' AND p.Options in ('RANGE SCAN', 'UNIQUE SCAN', 'SKIP SCAN')
THEN 1 ELSE 0 END
) = 1
-- Keine Filter
Expand Down
6 changes: 2 additions & 4 deletions app/helpers/dragnet/partitioning_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ def partitioning
MAX(p.SQL_ID) KEEP (DENSE_RANK LAST ORDER BY ash.Elapsed_Secs NULLS FIRST) Heaviest_SQL_ID,
MAX(ash.Elapsed_Secs) KEEP (DENSE_RANK LAST ORDER BY ash.Elapsed_Secs NULLS FIRST) Heaviest_SQL_Elapsed_Secs
FROM (
SELECT Inst_ID, Object_Owner, Object_Name, SQL_ID, Plan_Line_ID, Plan_Hash_Value, SUM(Executions) Executions,
LISTAGG(Partition_Start, ',') WITHIN GROUP (ORDER BY Partition_Start) Partition_Start_Values,
LISTAGG(Partition_Stop, ',') WITHIN GROUP (ORDER BY Partition_Stop) Partition_Stop_Values
SELECT Inst_ID, Object_Owner, Object_Name, SQL_ID, Plan_Line_ID, Plan_Hash_Value, SUM(Executions) Executions
FROM (
SELECT /*+ NO_MERGE MATERIALIZE */ p.Inst_ID, p.Object_Owner, p.Object_Name, p.SQL_ID, p.Partition_Start, p.Partition_Stop, p.Object_Type, p.Options, p.ID Plan_Line_ID, p.Plan_Hash_Value,
s.Executions
Expand All @@ -139,7 +137,7 @@ def partitioning
WHERE Partition_Start IS NOT NULL
AND Object_Name IS NOT NULL
AND Object_Type LIKE 'INDEX%'
AND Options IN ('UNIQUE SCAN', 'RANGE SCAN', 'RANGE SCAN (MIN/MAX)')
AND Options IN ('UNIQUE SCAN', 'RANGE SCAN', 'RANGE SCAN (MIN/MAX)', 'SKIP SCAN')
GROUP BY Inst_ID, Object_Owner, Object_Name, SQL_ID, Plan_Hash_Value, Plan_Line_ID
) p
LEFT OUTER JOIN Ash ON ash.Instance_Number = p.Inst_ID AND ash.SQL_ID = p.SQL_ID AND ash.SQL_Plan_Hash_Value = p.Plan_Hash_Value AND ash.SQL_Plan_Line_ID = p.Plan_Line_ID
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/dragnet/sqls_potential_db_structures_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def sqls_potential_db_structures
GROUP BY Inst_ID, SQL_ID, SQL_Plan_Hash_Value, SQL_Plan_Line_ID
) h ON h.Inst_ID=p.Inst_ID AND h.SQL_ID=p.SQL_ID AND h.SQL_Plan_Hash_Value=p.Plan_Hash_Value AND h.SQL_Plan_Line_ID=p.ID
LEFT OUTER JOIN DBA_Tables t ON t.Owner = p.Object_Owner AND t.Table_Name = p.Object_Name
WHERE p.Operation = 'TABLE ACCESS' AND p.Options = 'BY INDEX ROWID'
WHERE p.Operation = 'TABLE ACCESS' AND p.Options LIKE 'BY INDEX ROWID%'
AND p.Object_Owner NOT IN (#{system_schema_subselect})
AND NVL(t.Num_Rows, 0) < ?
) x
Expand Down Expand Up @@ -395,7 +395,7 @@ def sqls_potential_db_structures
GROUP BY DBID, Instance_Number, SQL_ID, SQL_Plan_Hash_Value, SQL_Plan_Line_ID
) h ON h.DBID = p.DBID AND h.SQL_ID=p.SQL_ID AND h.SQL_Plan_Hash_Value=p.Plan_Hash_Value AND h.SQL_Plan_Line_ID=p.ID
LEFT OUTER JOIN DBA_Tables t ON t.Owner = p.Object_Owner AND t.Table_Name = p.Object_Name
WHERE p.Operation = 'TABLE ACCESS' AND p.Options = 'BY INDEX ROWID'
WHERE p.Operation = 'TABLE ACCESS' AND p.Options LIKE 'BY INDEX ROWID%'
AND p.Object_Owner NOT IN (#{system_schema_subselect})
AND NVL(t.Num_Rows, 0) < ?
)
Expand Down
16 changes: 8 additions & 8 deletions app/helpers/dragnet/suboptimal_index_usage_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def suboptimal_index_usage
},
{
:name => t(:dragnet_helper_115_name, :default => 'Excessive filtering after TABLE ACCESS BY ROWID due to weak index access criteria (current SGA)'),
:desc => t(:dragnet_helper_115_desc, :default => 'INDEX RANGE SCAN with high number of rows returned and restrictive filter after TABLE ACCESS BY ROWID leads to unnecessary effort for table access before rejecting table records from result.
:desc => t(:dragnet_helper_115_desc, :default => 'INDEX RANGE|SKIP SCAN with high number of rows returned and restrictive filter after TABLE ACCESS BY ROWID leads to unnecessary effort for table access before rejecting table records from result.
You should consider to expand index by filter criterias of table access to reduce number of TABLE ACCESS BY ROWID.
This selection evaluates the current content of SGA.
Result is sorted by time effort for operation TABLE ACCESS BY ROWID.
Expand All @@ -45,15 +45,15 @@ def suboptimal_index_usage
ash.Min_Sample_Time, ash.Max_Sample_Time
FROM (SELECT /*+ MO_MERGE */ Inst_ID, SQL_ID, Plan_Hash_Value, Child_Number, Address, Access_Predicates, Filter_Predicates, ID, Cardinality, Object_Owner, Object_Name
FROM gv$SQL_Plan
WHERE Operation = 'TABLE ACCESS' AND Options LIKE 'BY%INDEX ROWID' /* should also catch BY LOCAL INDEX ROWID */
WHERE Operation = 'TABLE ACCESS' AND Options LIKE 'BY%INDEX ROWID%' /* should also catch BY LOCAL INDEX ROWID and INDEX ROWID BATCHED */
) ta
JOIN (SELECT /*+ MO_MERGE */ Inst_ID, SQL_ID, Plan_Hash_Value, Child_Number, Address, Access_Predicates, Filter_Predicates, Parent_ID, Cardinality, Object_Owner, Object_Name
FROM gv$SQL_Plan
WHERE Operation = 'INDEX' AND Options = 'RANGE SCAN'
WHERE Operation = 'INDEX' AND Options IN ('RANGE SCAN', 'SKIP SCAN')
) ir ON ir.Inst_ID=ta.Inst_ID AND ir.SQL_ID=ta.SQL_ID AND ir.Plan_Hash_Value=ta.Plan_Hash_Value AND ir.Child_Number=ta.Child_Number AND ir.Address=ta.Address AND ir.Parent_ID=ta.ID
JOIN (SELECT /*+ NO_MERGE */ Inst_ID, SQL_ID, SQL_Child_Number, SQL_Plan_Hash_Value, SQL_Plan_Line_ID, COUNT(*) Seconds, MIN(Sample_Time) Min_Sample_Time, MAX(Sample_Time) Max_Sample_Time
FROM gv$Active_Session_History
WHERE SQL_Plan_Operation = 'TABLE ACCESS' AND SQL_Plan_Options LIKE 'BY%INDEX ROWID' /* only for this operation */
WHERE SQL_Plan_Operation = 'TABLE ACCESS' AND SQL_Plan_Options LIKE 'BY%INDEX ROWID%' /* only for this operation */
GROUP BY Inst_ID, SQL_ID, SQL_Child_Number, SQL_Plan_Hash_Value, SQL_Plan_Line_ID
HAVING COUNT(*) > ?
) ash ON ash.Inst_ID=ta.Inst_ID AND ash.SQL_ID=ta.SQL_ID AND ash.SQL_Child_Number=ta.Child_Number AND ash.SQL_Plan_Hash_Value=ta.Plan_Hash_Value AND ash.SQL_Plan_Line_ID=ta.ID
Expand All @@ -67,7 +67,7 @@ def suboptimal_index_usage
},
{
:name => t(:dragnet_helper_116_name, :default => 'Excessive filtering after TABLE ACCESS BY ROWID due to weak index access criteria (AWR history)'),
:desc => t(:dragnet_helper_116_desc, :default => 'INDEX RANGE SCAN with high number of rows returned and restrictive filter after TABLE ACCESS BY ROWID leads to unnecessary effort for table access before rejecting table records from result.
:desc => t(:dragnet_helper_116_desc, :default => 'INDEX RANGE|SKIP SCAN with high number of rows returned and restrictive filter after TABLE ACCESS BY ROWID leads to unnecessary effort for table access before rejecting table records from result.
You should consider to expand index by filter criterias of table access to reduce number of TABLE ACCESS BY ROWID.
This selection evaluates the AWR history.
Result is sorted by time effort for operation TABLE ACCESS BY ROWID.
Expand All @@ -76,16 +76,16 @@ def suboptimal_index_usage
ir.Access_Predicates Access_Index, ir.Filter_Predicates Filter_Index, ta.Access_Predicates Access_Index, ta.Filter_Predicates Filter_Index, ROUND(ir.Cardinality/ta.Cardinality) Cardinality_Ratio, ash.Seconds Elapsed_Seconds
FROM (SELECT /*+ MO_MERGE */ DBID, SQL_ID, Plan_Hash_Value, Access_Predicates, Filter_Predicates, ID, Cardinality, Object_Owner, Object_Name
FROM DBA_Hist_SQL_Plan
WHERE Operation = 'TABLE ACCESS' AND Options LIKE 'BY%INDEX ROWID' /* should also catch BY LOCAL INDEX ROWID */
WHERE Operation = 'TABLE ACCESS' AND Options LIKE 'BY%INDEX ROWID%' /* should also catch BY LOCAL INDEX ROWID and INDEX ROWID BATCHED */
) ta
JOIN (SELECT /*+ MO_MERGE */ DBID, SQL_ID, Plan_Hash_Value, Access_Predicates, Filter_Predicates, Parent_ID, Cardinality, Object_Owner, Object_Name
FROM DBA_Hist_SQL_Plan
WHERE Operation = 'INDEX' AND Options = 'RANGE SCAN'
WHERE Operation = 'INDEX' AND Options IN ('RANGE SCAN', 'SKIP SCAN')
) ir ON ir.DBID=ta.DBID AND ir.SQL_ID=ta.SQL_ID AND ir.Plan_Hash_Value=ta.Plan_Hash_Value AND ir.Parent_ID=ta.ID
JOIN (SELECT /*+ NO_MERGE */ DBID, Instance_Number, SQL_ID, SQL_Child_Number, SQL_Plan_Hash_Value, SQL_Plan_Line_ID, COUNT(*) Seconds
FROM DBA_Hist_Active_Sess_History
WHERE Sample_Time > SYSDATE - ?
AND SQL_Plan_Operation = 'TABLE ACCESS' AND SQL_Plan_Options LIKE 'BY%INDEX ROWID'
AND SQL_Plan_Operation = 'TABLE ACCESS' AND SQL_Plan_Options LIKE 'BY%INDEX ROWID%'
AND DBID = #{get_dbid} /* do not count multiple times for multipe different DBIDs/ConIDs */
GROUP BY DBID, Instance_Number, SQL_ID, SQL_Child_Number, SQL_Plan_Hash_Value, SQL_Plan_Line_ID
HAVING COUNT(*) > ?
Expand Down
Loading

0 comments on commit d843a6b

Please sign in to comment.