From: Michael E. <er...@di...> - 2022-01-23 10:50:14
|
Hello list, My wiki cannot find values for a property chain (although the values do exist). Q1 This query returns many empty values for "CityName" (the City column, though has values) {{#ask: [[Kategorie:House]] |?City.CityName=CityName |?City |format=broadtable }} Q2 Whereas this query always returns values for "CityName" {{#ask: [[Kategorie:House]] [[City::City_43]] |?City.CityName=CityName |?City |format=broadtable }} More specifically: The second query returns values for "CityName" even for cases in which the first one is not showing anything. And Q2 is correct. Updating either the House or the City page does not change this behavior. Other SMW queries with property chains seem to work fine. I am at my wits' end. This looks like an SMW bug to me. But I cannot believe it has not been spotted before. I run SMW 3.2.3 on MW 1.35.4 with PHP 7.3.33 and MariaDB 10.4.22. In case it helps, here is the output of DEBUG for both queries Q1 Debug output SQLStore ASK Query [[Kategorie:House]] SQL Query SELECT DISTINCT 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 t1 INNER JOIN `t2` AS t2 ON t1.o_id=t2.id ) ON t0.smw_id=t1.s_id WHERE t0.smw_iw!=':smw' AND t0.smw_iw!=':smw-delete' AND t0.smw_iw!=':smw-redi' ORDER BY t0.smw_sort ASC LIMIT 205 OFFSET 0 SQL Explain ID select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL PRIMARY 4 Using temporary; Using filesort 1 SIMPLE t1 ref s_id, o_id, s_id_2, o_id_2 o_id_2 5 wikidb2021.t2.id 3079 Using index 1 SIMPLE t0 eq_ref PRIMARY, smw_id, smw_iw, smw_iw_2 PRIMARY 4 wikidb2021.t1.s_id 1 Using where Auxilliary Tables Temporary table t2 Recursively computed hierarchy for element(s) (512). SELECT s_id FROM `smw_fpt_subc` WHERE o_id=512 LIMIT 1 Query Metrics Query-Size:1 Query-Depth:0 Errors and Warnings None Q2 Debug output SQLStore ASK Query [[Kategorie:House]] [[City::City 43]] SQL Query SELECT DISTINCT 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 t1 INNER JOIN `t2` AS t2 ON t1.o_id=t2.id INNER JOIN `smw_di_wikipage` AS t4 ON t1.s_id=t4.s_id ) ON t0.smw_id=t1.s_id WHERE ( (t4.p_id=845 AND t4.o_id=19928) ) AND t0.smw_iw!=':smw' AND t0.smw_iw!=':smw-delete' AND t0.smw_iw!=':smw-redi' ORDER BY t0.smw_sort ASC LIMIT 205 OFFSET 0 SQL Explain ID select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ref s_id, o_id, p_id, s_id_2, s_id_3, o_id_2, o_id_3 o_id 5 const 231 Using where; Using temporary; Using filesort 1 SIMPLE t0 eq_ref PRIMARY, smw_id, smw_iw, smw_iw_2 PRIMARY 4 wikidb2021.t4.s_id 1 Using where 1 SIMPLE t1 ref s_id, o_id, s_id_2, o_id_2 s_id_2 4 wikidb2021.t4.s_id 1 Using index 1 SIMPLE t2 ALL PRIMARY 4 Using where; Using join buffer (flat, BNL join) Auxilliary Tables Temporary table t2 Recursively computed hierarchy for element(s) (512). SELECT s_id FROM `smw_fpt_subc` WHERE o_id=512 LIMIT 1 Query Metrics Query-Size:3 Query-Depth:1 Errors and Warnings None Any feedback greatly appreciated. CU, michael -- Dr. Michael Erdmann |er...@di... | +49 151 6140 1790 DIQA Projektmanagement GmbH | An der RaumFabrik 33c | 76227 Karlsruhe Handelsregister: Amtsgericht Mannheim HRB 715454 USt-IdNr.: DE283037270 Geschäftsführer: Dr. Michael Erdmann, Dipl.-Wirtsch.-Inf. Daniel Hansch This email may contain confidential information. If you are not the intended recipient please notify the sender immediately and delete this email. Any unauthorized copying, disclosure or distribution of this email is strictly forbidden. |