Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace: add hash value for text of every executed statement [CORE5736] #6000

Open
firebird-automations opened this issue Feb 1, 2018 · 2 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

It will be very useful to have ability for quick find in a trace log with huge size some HASH value of statement that was executed.
Consider following sketch:

EXECUTE_STATEMENT_FINISH -------------------------------- [ 1 ]
select <...>
from test1 a
left join test2 b on ...
left join test3 c on ...
...
where <expr_for_a,b,c>
< POOR EXECUTION AND TABLE STATISTICS HERE >

EXECUTE_STATEMENT_FINISH
<... some_other_complex_query_2 ...>

EXECUTE_STATEMENT_FINISH
<... yet_another_complex_query_3...>

EXECUTE_STATEMENT_FINISH -------------------------------- [ 2 ]
select <...>
from test1 a
left join test2 b on ...
left join test3 c on ...
...
where <expr_for_a,b,c>
< POOR EXECUTION AND TABLE STATISTICS HERE >

When someone will read text below [ 2 ] , he can recall that PROBABLY the same query was already registered before, in [1 ].
But how one may easy and fast to compare such text blocks ? They often take about 50-70 lines of code, and - moreover - this code can be machine-generated.
Of course we can make copy-paste these queries in two diff. files and than compare them. But this is completely inconvenient.

So, please consider ability to add some king of hash value for each executed statement, like this:

2018-02-01T12:20:23.4500 ( <HASH_STRING_FOR_STATEMENT_HERE> ) EXECUTE_STATEMENT_FINISH
prodbase (ATT_29570445, JOHN:MANAGER, UTF8, TCPv4:172.16.190.9)
c:\temp\my_app.exe:4724
(TRA_738419170, READ_COMMITTED | REC_VERSION | WAIT | READ_ONLY)

Statement 108112340:
-------------------------------------------------------------------------------
select count(*) from ...

/*
CURRENTLY within parenthesis there is always the same value (and i don't understand what does it mean). Can we replace it with more useful one ?
*/

PS.
And if it is possible, may be the same hash value can be added for mon$statements.mon$sql_text ?

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

description: It will be very useful to have ability for quick find in a trace log with huge size some HASH value of statement that was executed.
Consider following sketch:

EXECUTE_STATEMENT_FINISH -------------------------------- [ 1 ]
select <...>
from test1 a
left join test2 b on ...
left join test3 c on ...
...
where <expr_for_a,b,c>
< POOR EXECUTION AND TABLE STATISTICS HERE >

EXECUTE_STATEMENT_FINISH
<... some_other_complex_query_2 ...>

EXECUTE_STATEMENT_FINISH
<... yet_another_complex_query_3...>

EXECUTE_STATEMENT_FINISH -------------------------------- [ 2 ]
select <...>
from test1 a
left join test2 b on ...
left join test3 c on ...
...
where <expr_for_a,b,c>
< POOR EXECUTION AND TABLE STATISTICS HERE >

When someone will read text below [ 2 ] , he can recall that PROBABLY the same query already was already registered before, in [1 ].
But how one may easy and fast to compare such text blocks ? They often take about 50-70 lines of code, and - moreover - this code can be machine-generated.
Of course we can make copy-paste these queries in two diff. files and than compare them. But this is completely inconvenient.

So, please consider ability to add some king of hash value for each executed statement, like this:

2018-02-01T12:20:23.4500 ( <HASH_STRING_FOR_STATEMENT_HERE> ) EXECUTE_STATEMENT_FINISH
prodbase (ATT_29570445, JOHN:MANAGER, UTF8, TCPv4:172.16.190.9)
c:\temp\my_app.exe:4724
(TRA_738419170, READ_COMMITTED | REC_VERSION | WAIT | READ_ONLY)

Statement 108112340:
-------------------------------------------------------------------------------
select count(*) from ...

/*
CURRENTLY within parenthesis there is always the same value (and i don't understand what does it mean). Can we replace it with more useful one ?
*/

PS.
And if it is possible, may be the same hash value can be added for mon$statements.mon$sql_text ?

=>

It will be very useful to have ability for quick find in a trace log with huge size some HASH value of statement that was executed.
Consider following sketch:

EXECUTE_STATEMENT_FINISH -------------------------------- [ 1 ]
select <...>
from test1 a
left join test2 b on ...
left join test3 c on ...
...
where <expr_for_a,b,c>
< POOR EXECUTION AND TABLE STATISTICS HERE >

EXECUTE_STATEMENT_FINISH
<... some_other_complex_query_2 ...>

EXECUTE_STATEMENT_FINISH
<... yet_another_complex_query_3...>

EXECUTE_STATEMENT_FINISH -------------------------------- [ 2 ]
select <...>
from test1 a
left join test2 b on ...
left join test3 c on ...
...
where <expr_for_a,b,c>
< POOR EXECUTION AND TABLE STATISTICS HERE >

When someone will read text below [ 2 ] , he can recall that PROBABLY the same query was already registered before, in [1 ].
But how one may easy and fast to compare such text blocks ? They often take about 50-70 lines of code, and - moreover - this code can be machine-generated.
Of course we can make copy-paste these queries in two diff. files and than compare them. But this is completely inconvenient.

So, please consider ability to add some king of hash value for each executed statement, like this:

2018-02-01T12:20:23.4500 ( <HASH_STRING_FOR_STATEMENT_HERE> ) EXECUTE_STATEMENT_FINISH
prodbase (ATT_29570445, JOHN:MANAGER, UTF8, TCPv4:172.16.190.9)
c:\temp\my_app.exe:4724
(TRA_738419170, READ_COMMITTED | REC_VERSION | WAIT | READ_ONLY)

Statement 108112340:
-------------------------------------------------------------------------------
select count(*) from ...

/*
CURRENTLY within parenthesis there is always the same value (and i don't understand what does it mean). Can we replace it with more useful one ?
*/

PS.
And if it is possible, may be the same hash value can be added for mon$statements.mon$sql_text ?

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment