Bug Report #613

Benchmarks for special database queries

Added by charlie - over 3 years ago. Updated over 2 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Woody Gilk % Done:

100%

Category:Libraries:Database
Target version:2.4
Resolution:fixed Points:

Description

The database operations 'list_fields', 'list_tables', and 'field_data' (probably others as well) don't display in the benchmarks. These may be useful to record because they do take some time (often more than moderately sized queries).

I'm willing to implement this, although it seems likely that the actual contents of the query will not be accessible without changes to these functions. I could change them to return the executed query, or just record the function, i.e. "Database::list_fields($table)" as the query.

database.patch - simple method for benchmarking 'special' database operations (2.4 kB) charlie -, 05/29/2008 04:50 pm

Benchmark-database-introspection.patch - against trunk (6.1 kB) Chris Bandy, 05/14/2009 07:54 am

Benchmark-database-introspection-2.4.patch - against 2.4 (648 Bytes) Chris Bandy, 05/14/2009 08:23 am


Related issues

related to Kohana v2.x - Bug Report #1264: Cross-request Database Cache must perform the caching of ... 2.4 Closed

Associated revisions

History

Updated by charlie - over 3 years ago

I've attached a simple patch for benchmarking the Database::list_tables(), Database::list_fields(), and Database::field_data() functions without any changes required in the drivers. To enable these benchmarks, set the 'profile_all' flag in the database config to true.

Only the invoked function names are displayed in the query, not the actual SQL. To display the SQL, changes would need to be made to the database drivers. This could take two forms:

1. Drivers return an array with both a query and result, and the database library adds the returned query to the benchmarked queries.

2. Drivers have their own benchmark array which are appended to the database benchmark array before profiler output. (results in special queries being shown after all normal queries - not in order of execution).

The solution I've posted is all I need, but if someone feels strongly about either of the two other options I'll implement one of those.

Updated by Woody Gilk over 3 years ago

  • Status changed from New to Assigned

Updated by Woody Gilk over 3 years ago

  • Status changed from Assigned to Closed
  • Resolution set to fixed

Fixed in r3336.

Updated by Woody Gilk almost 3 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

This was fixed in pre_3.0 but never backported, so it needs probably needs to be re-merged into current trunk and 2.4.

Updated by Woody Gilk almost 3 years ago

  • Status changed from Feedback to Assigned

Updated by Chris Bandy over 2 years ago

Here is another approach. I don't know if I like the Driver manipulating the Database member though.

Updated by Chris Bandy over 2 years ago

Drivers in 2.4 are much nicer. This has the added benefit of caching introspection queries when caching is enabled.

Updated by Jeremy Bush over 2 years ago

  • Target version changed from 2.3.3 to 2.4

Updated by John Heathco over 2 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
  • Resolution set to fixed
  • 11 set to 2.3.4

Also available in: Atom PDF