Skip to content

Instantly share code, notes, and snippets.

@justinclloyd
Created May 5, 2021 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinclloyd/35563abf4c790cc8abdc0df5c928c170 to your computer and use it in GitHub Desktop.
Save justinclloyd/35563abf4c790cc8abdc0df5c928c170 to your computer and use it in GitHub Desktop.
SMW SQL query diff
--- debug1.sql 2021-05-05 12:33:09.476873807 -0700
+++ debug2.sql 2021-05-05 12:33:30.863692716 -0700
@@ -4,7 +4,7 @@
t0.smw_namespace AS ns,
t0.smw_iw AS iw,
t0.smw_subobject AS so,
- t0.smw_sortkey AS sortkey, t0.smw_sort
+ t0.smw_sortkey AS sortkey, t14.o_sortkey
FROM
`smw_object_ids` AS t0
INNER JOIN
@@ -15,6 +15,10 @@
`smw_di_blob` AS t7 ON t5.o_id=t7.s_id) ON t2.s_id=t5.s_id
INNER JOIN
`smw_di_bool` AS t9 ON t2.s_id=t9.s_id) ON t0.smw_id=t2.s_id
+INNER JOIN
+ (`smw_di_wikipage` AS t12
+INNER JOIN
+ `smw_di_number` AS t14 ON t12.o_id=t14.s_id) ON t0.smw_id=t12.s_id
WHERE
(t2.p_id=5730828 AND t2.o_id=222396
AND (t5.p_id=5730768
@@ -24,11 +28,14 @@
AND (
(t9.o_value=0) AND t9.p_id=5730700)
)
+ AND (t12.p_id=5730782
+ AND (t14.p_id=5730758)
+ )
AND t0.smw_iw!=':smw'
AND t0.smw_iw!=':smw-delete'
AND t0.smw_iw!=':smw-redi'
ORDER BY
- t0.smw_sort ASC
+ t14.o_sortkey ASC
LIMIT
255
OFFSET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment