Ticket #613 (closed Patch: fixed)

Opened 5 months ago

Last modified 7 weeks ago

Benchmarks for special database queries

Reported by: charlie Owned by: Shadowhand
Priority: minor Milestone: 2.3
Component: Libraries:Database Version: SVN HEAD
Keywords: Cc:

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.

Attachments

database.patch (2.4 kB) - added by charlie 4 months ago.
simple method for benchmarking 'special' database operations

Change History

Changed 4 months ago by charlie

simple method for benchmarking 'special' database operations

Changed 4 months ago by charlie

  • type changed from Feature Request to Patch
  • milestone changed from 2.2 to 2.1.2

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.

Changed 4 months ago by Shadowhand

  • milestone changed from 2.1.2 to 2.2

Changed 7 weeks ago by Shadowhand

  • owner changed from zombor to Shadowhand
  • status changed from new to assigned
  • milestone changed from 2.2 to 2.3

Changed 7 weeks ago by Shadowhand

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r3336.

Note: See TracTickets for help on using tickets.