Bug Report #613
Benchmarks for special database queries
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % 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.
Related issues
Associated revisions
Fixing #613
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
- File Benchmark-database-introspection.patch added
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
- File Benchmark-database-introspection-2.4.patch added
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