Trace output - query Times - how?

14 views
Skip to first unread message

Karol Bieniaszewski

unread,
Nov 24, 2022, 3:44:04 AM11/24/22
to firebird...@googlegroups.com

Hi

 

I try to analyse some process but i see that output from trace do not allow me to catch query times outside of application.

e.g. i got output Times:

 

2022-11-23T21:12:54.3880 PREPARE_STATEMENT

2022-11-23T21:12:54.4030 EXECUTE_STATEMENT_START

multiple other statements

2022-11-23T21:12:54.9550 CLOSE_CURSOR

2022-11-23T21:12:54.9710 FREE_STATEMENT

 

The whole porcess is in one connection and one thread, and it is sequential operation. No onther connections (except application with trace session).

 

The statement is:

select count(*) from some_table where ...

 

and result of count is 0.

 

Then in trace i do not see time like e.g. 25 ms like for other statements.

I do not see EXECUTE_STATEMENT_FINISH which normally provide such information i see only CLOSE_CURSOR.

I cannot simply substract CLOSE_CURSOR time and EXECUTE_STATEMENT_START as it is not the query time.

If i do simply substract like this, and sum particullar statements i see that whlole proces take 2 hours but it really take 7 minutes.

 

In Delphi code it is something like this in loop:

 

Open dataset1

Start some transaction

Open dataset2

Insert some data

Close dataset2

Commit transaction

Close dataset1

 

Dataset1 is with above select count(*) statement.

I know, it can be done in different way, but it is not my application. My application is for analysing trace 😉

How can i provide times for queries to show some hint where the problem is?

 

Regards,

Karol Bieniaszewski

 

Tomasz Dubiel

unread,
Nov 24, 2022, 3:46:45 AM11/24/22
to firebird-support
Do you have everything here enabled?
log_statement_finish  = true
log_procedure_finish =  true
log_function_finish = true
log_trigger_finish   =  true

Karol Bieniaszewski

unread,
Nov 24, 2022, 4:16:56 AM11/24/22
to firebird...@googlegroups.com

Yes,

 

{

enabled=true

log_connections=true

connection_id=0

log_transactions=true

log_statement_prepare=true

log_statement_free=true

log_statement_start=true

log_statement_finish=true

print_plan=true

explain_plan=true

max_sql_length=62000

print_perf=true

time_threshold = 100

log_procedure_start = true

log_procedure_start = true

log_procedure_finish = true

log_function_start = true

log_function_finish = true

log_trigger_start = true

log_trigger_finish = true

log_errors = true

log_sweep = true

log_dyn_requests = true

print_dyn = true

}

 

Regards,

Karol Bieniaszewski

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/4e1248ff-2ebd-43ba-a563-d4bdfe148205n%40googlegroups.com.

 

Tomasz Dubiel

unread,
Nov 24, 2022, 4:18:37 AM11/24/22
to firebird...@googlegroups.com
Time threshold = 100 :-)

Karol Bieniaszewski

unread,
Nov 24, 2022, 4:24:26 AM11/24/22
to firebird...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages