0

Using Kohana framework v3 I have created model with N methods using query builder. For example N-10% - use DB::select().
Is there any integrated functionality to do explain select for each method which use DB::select()?

I think to do this in this way:

Extend base query builder class and in Application folder remap execute() function with same code as was original, but add string which will write into mysql_log_of_selects.txt result of execution each select query with prepended EXPLAIN to it.
But what will propose you? Thanks!

LINKeRxUA
  • 559
  • 6
  • 26
  • I don really understand what is your goal. You need the last executed query string? – mobal Nov 17 '14 at 12:59
  • @mobal, I need to do something like "stress test for mysql queries". So I want to add "`EXPLAIN `" Before each final query and result of execution save to log file. My question is: Does the KO3 have this functionality, or I must extend base DB class and modify it? – LINKeRxUA Nov 17 '14 at 13:07
  • Extend the base class or your model with this logic. I think there is no options (i searched but not found) like this. – mobal Nov 17 '14 at 13:17

1 Answers1

0

Extend base query builder class and in Application folder remap execute() function with same code as was in original, but add "EXPLAIN " before each final query and result of it's execution save to log file.

LINKeRxUA
  • 559
  • 6
  • 26