Help:Debug format
Debug format | |
---|---|
Outputs debugging information for analyzing problems in query answering. | |
Further Information | |
Provided by: | Semantic MediaWiki |
Added: | 0.7 |
Removed: | still supported |
Requirements: | none |
Format name: | debug |
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. | yes |
Authors: | Markus Krötzsch |
Categories: | misc |
Table of Contents | |
The result format debug is used to obtain background information on how Semantic MediaWiki has processed a query. This information helps to understand why a query might return unexpected results, and it is vital for developers to fix bugs in query answering.
Parameters[edit]
There are no inline query parameters specific to the debug format. This result format does not provide format specific parameters.
Example[edit]
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?area#km²=Area |format=debug }}
- Result
t0.smw_id AS id,
t0.smw_title AS t,
t0.smw_namespace AS ns,
t0.smw_iw AS iw,
t0.smw_subobject AS so,
t0.smw_sortkey AS sortkey, t0.smw_sort
FROM
`smw_object_ids` AS t0
INNER JOIN
(`smw_fpt_inst` AS t2
INNER JOIN
`t3` AS t3 ON t2.o_id=t3.id
INNER JOIN
(`smw_di_wikipage` AS t4
INNER JOIN
`t5` AS t5 ON t4.p_id=t5.id) ON t2.s_id=t4.s_id) ON t0.smw_id=t2.s_id
WHERE
(
(t4.o_id='779')
)
AND t0.smw_iw!=':smw'
AND t0.smw_iw!=':smw-delete'
AND t0.smw_iw!=':smw-redi'
ORDER BY
t0.smw_sort ASC
LIMIT
55
OFFSET
0
ID | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
---|---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | t5 | ALL | PRIMARY | 2 | Using temporary; Using filesort | ||||
1 | SIMPLE | t4 | ref | s_id, o_id, p_id, s_id_2, s_id_3, o_id_2, o_id_3 | o_id_3 | 9 | const, DB9907220070920.t5.id | 1 | ||
1 | SIMPLE | t2 | ref | s_id, o_id, s_id_2, o_id_2 | s_id_2 | 4 | DB9907220070920.t4.s_id | 1 | Using where; Using index | |
1 | SIMPLE | t3 | eq_ref | PRIMARY | PRIMARY | 4 | DB9907220070920.t2.o_id | 1 | ||
1 | SIMPLE | t0 | eq_ref | PRIMARY, smw_id, smw_iw, smw_iw_2 | PRIMARY | 4 | DB9907220070920.t4.s_id | 1 | Using where |
- Temporary table t3
Recursively computed hierarchy for element(s) ('148509').
SELECT s_id FROM `smw_fpt_subc` WHERE o_id='148509' LIMIT 1 - Temporary table t5
Recursively computed hierarchy for element(s) ('148244').
SELECT s_id FROM `smw_fpt_subp` WHERE o_id='148244' LIMIT 1
Query-Depth:1
How to read the debug output[edit]
The debug output contains some information that is only useful to developers, but it also gives some information that can be instructive to editors in a wiki for debugging a query.
The more readable parts are shown on top. This is usually a version of the wiki query as understood by SMW. The displayed query might be different from the user input. This may be due to SMW simply expressing some queries in different ways (different style of writing) but it may also show that some parts of the query were not understood or were wrongly understood by SMW.
Some statistical information on query size and query depth, and the encountered error messages are also shown. The size and depth are internal parameters used by SMW to limit the complexity of queries. The administrator of a wiki site may restrict queries to some maximal query size or depth (this will then be shown as an error if problematic), and this output may help to understand how size and depth work with certain queries.
The rest of the debug output is usually related to the internal storage functions executed by SMW to answer the query. This part also depends on the particular storage implementation and version of SMW, and usually developers will be the only ones to have any use for this.
Remarks[edit]
The details of the debug output depend on the version of SMW and the storage engine used. This information should be included into debug reports.