jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Parvulescu <alex.parvule...@gmail.com>
Subject Re: Strange Search Performance problem with OR
Date Tue, 27 Mar 2012 16:15:18 GMT
Hi,

I've created JCR-3280 [0]. It would be interesting if you could take it for
a spin ;)

best,
alex

[0] https://issues.apache.org/jira/browse/JCR-3280


On Tue, Mar 27, 2012 at 5:49 PM, Alex Parvulescu
<alex.parvulescu@gmail.com>wrote:

> hi,
>
> > unfortunately the debug is not that descriptive (from my POV :))
>
> yes, well the idea is to make it more user friendly :)
> I added it with joins in mind so it doesn't say much (ahem, anything)
> about how normal queries break down to lucene queries.
>
> About the join query: it appears that in the case of the 0 hits, the query
> engine is terribly inefficient, it fetches the entire subset of nodes:
>
> > SQL2 JOIN LEFT SIDE took 8 ms. fetched 0 rows.
> > SQL2 JOIN RIGHT SIDE took 845 ms. fetched 13055 rows.
> ...so it fetches 130k nodes and doesn't keep any of them.
>
> whereas when it has something to work with it is able to generate some
> proper conditions
> > SQL2 JOIN LEFT SIDE took 18 ms. fetched 145 rows.
> > SQL2 JOIN RIGHT SIDE took 67 ms. fetched 0 rows.
>
> There is room for improvement here :)
> I'm thinking if the left side of the join is empty, we can skip looking
> for the right side entirely.
> I'll create an issue to track this improvement.
>
> good catch!
>
> As for the other example, we can look into it tomorrow :)
>
>
> best,
> alex
>
>
> On Tue, Mar 27, 2012 at 3:24 PM, Christian Stocker <
> christian.stocker@liip.ch> wrote:
>
>> Hi Alex
>>
>> unfortunately the debug is not that descriptive (from my POV :))
>>
>> For the query with the OR
>>
>>
>> 2012-03-27 15:14:44.086 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465   SQL2 SELECT took 6642 ms. selector:
>> [own:unstructured] AS data, columns: [data.jcr:primaryType], constraint:
>> (data.guid = 'J7B1X') AND ((ISDESCENDANTNODE(data, [/article])) OR
>> (ISDESCENDANTNODE(data, [/import/article]))), offset 0, limit 5
>> 2012-03-27 15:14:44.087 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480   SQL2 SORT took 0 ms.
>> 2012-03-27 15:14:44.087 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:117 SQL2 QUERY execute took 6643 ms. native sort is
>> false.
>>
>>
>> For the query without the or
>>
>> 2012-03-27 15:15:44.774 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465   SQL2 SELECT took 5 ms. selector:
>> [own:unstructured] AS data, columns: [data.jcr:primaryType], constraint:
>> (data.guid = 'J7B1X') AND (ISDESCENDANTNODE(data, [/article])), offset
>> 0, limit 5
>> 2012-03-27 15:15:44.775 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480   SQL2 SORT took 0 ms.
>> 2012-03-27 15:15:44.775 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:117 SQL2 QUERY execute took 6 ms. native sort is false.
>>
>>
>> For the later with no results:
>> (or as file https://gist.github.com/761084c44997d6c7ad11)
>>
>> 2012-03-27 15:19:53.406 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:393   SQL2 JOIN analysis:
>>  SQL2 JOIN inner split ->
>>  +
>>      SQL2 JOIN source: [own:unstructured] AS data LEFT OUTER JOIN
>> [own:unstructured] AS referring ON referring.reference = data.[jcr:uuid]
>>      SQL2 JOIN left constraint:  (((data.[phpcr:class] =
>> 'Own\ApiBundle\Document\Article') AND (data.publication = 'own')) AND
>> ((CONTAINS(data.categories, 'KURZ')) AND (data.departmentSlugs =
>> 'front'))) AND (((NOT (data.permissionPath like 'owns/%')) AND
>> (data.title IS NOT NULL)) AND ((data.title <> '') AND ((data.teaser IS
>> NOT NULL) AND (data.teaser <> ''))))
>>      SQL2 JOIN right constraint: (referring.reference IS NOT NULL) AND
>> (ISDESCENDANTNODE(referring, [/article/2012/03/26]))
>>  +
>>      SQL2 JOIN source: [own:unstructured] AS data LEFT OUTER JOIN
>> [own:unstructured] AS referring ON referring.reference = data.[jcr:uuid]
>>      SQL2 JOIN left constraint:  (((data.[phpcr:class] =
>> 'Own\ApiBundle\Document\Article') AND (data.publication = 'own')) AND
>> ((CONTAINS(data.categories, 'KURZ')) AND ((data.departmentSlugs =
>> 'front') AND (NOT (data.permissionPath like 'owns/%'))))) AND
>> (((data.title IS NOT NULL) AND (data.title <> '')) AND ((data.teaser IS
>> NOT NULL) AND ((data.teaser <> '') AND (ISDESCENDANTNODE(data,
>> [/article/2012/03/26])))))
>>      SQL2 JOIN right constraint: null
>> 2012-03-27 15:19:53.407 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:182    SQL2 JOIN execute: there are multiple inner
>> splits.
>> 2012-03-27 15:19:53.414 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 7 ms. selector:
>> [own:unstructured] AS data, columns: [data.jcr:primaryType], constraint:
>> (((data.[phpcr:class] = 'Own\ApiBundle\Document\Article') AND
>> (data.publication = 'own')) AND ((CONTAINS(data.categories, 'KURZ')) AND
>> (data.departmentSlugs = 'front'))) AND (((NOT (data.permissionPath like
>> 'owns/%')) AND (data.title IS NOT NULL)) AND ((data.title <> '') AND
>> ((data.teaser IS NOT NULL) AND (data.teaser <> '')))), offset 0, limit -1
>> 2012-03-27 15:19:53.414 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:19:53.415 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:222       SQL2 JOIN LEFT SIDE took 8 ms. fetched 0 rows.
>> 2012-03-27 15:19:53.544 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 129 ms. selector:
>> [own:unstructured] AS referring, columns: [referring.jcr:primaryType],
>> constraint: null, offset 0, limit -1
>> 2012-03-27 15:19:53.544 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:19:54.259 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 6 ms. selector:
>> [own:unstructured] AS referring, columns: [referring.jcr:primaryType],
>> constraint: (referring.reference IS NOT NULL) AND
>> (ISDESCENDANTNODE(referring, [/article/2012/03/26])), offset 0, limit -1
>> 2012-03-27 15:19:54.260 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:19:54.260 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:261       SQL2 JOIN RIGHT SIDE took 845 ms. fetched
>> 13055 rows.
>> 2012-03-27 15:19:54.340 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:197    SQL2 JOIN executed first branch, took 933 ms.
>> 2012-03-27 15:19:54.346 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 6 ms. selector:
>> [own:unstructured] AS data, columns: [data.jcr:primaryType], constraint:
>> (((data.[phpcr:class] = 'Own\ApiBundle\Document\Article') AND
>> (data.publication = 'own')) AND ((CONTAINS(data.categories, 'KURZ')) AND
>> ((data.departmentSlugs = 'front') AND (NOT (data.permissionPath like
>> 'owns/%'))))) AND (((data.title IS NOT NULL) AND (data.title <> '')) AND
>> ((data.teaser IS NOT NULL) AND ((data.teaser <> '') AND
>> (ISDESCENDANTNODE(data, [/article/2012/03/26]))))), offset 0, limit -1
>> 2012-03-27 15:19:54.347 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:19:54.347 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:222       SQL2 JOIN LEFT SIDE took 7 ms. fetched 0 rows.
>> 2012-03-27 15:19:54.412 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 64 ms. selector:
>> [own:unstructured] AS referring, columns: [referring.jcr:primaryType],
>> constraint: null, offset 0, limit -1
>> 2012-03-27 15:19:54.412 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:19:55.172 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:261       SQL2 JOIN RIGHT SIDE took 825 ms. fetched
>> 13055 rows.
>> 2012-03-27 15:19:55.259 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:211    SQL2 JOIN executed second branch, took 919 ms.
>> 2012-03-27 15:19:55.259 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:168     SQL2 SORT took 0 ms.
>> 2012-03-27 15:19:55.259 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:117 SQL2 QUERY execute took 1853 ms. native sort is
>> false.
>>
>>
>> with results:
>>
>> (as file https://gist.github.com/c52b2d87558f90a491cc )
>>
>> 2012-03-27 15:22:17.114 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:393   SQL2 JOIN analysis:
>>  SQL2 JOIN inner split ->
>>  +
>>      SQL2 JOIN source: [own:unstructured] AS data LEFT OUTER JOIN
>> [own:unstructured] AS referring ON referring.reference = data.[jcr:uuid]
>>      SQL2 JOIN left constraint:  (((data.[phpcr:class] =
>> 'Own\ApiBundle\Document\Article') AND (data.publication = 'own')) AND
>> ((CONTAINS(data.categories, 'KURZ')) AND (data.departmentSlugs =
>> 'international'))) AND (((NOT (data.permissionPath like 'owns/%')) AND
>> (data.title IS NOT NULL)) AND ((data.title <> '') AND ((data.teaser IS
>> NOT NULL) AND (data.teaser <> ''))))
>>      SQL2 JOIN right constraint: (referring.reference IS NOT NULL) AND
>> (ISDESCENDANTNODE(referring, [/article/2012/03/26]))
>>  +
>>      SQL2 JOIN source: [own:unstructured] AS data LEFT OUTER JOIN
>> [own:unstructured] AS referring ON referring.reference = data.[jcr:uuid]
>>      SQL2 JOIN left constraint:  (((data.[phpcr:class] =
>> 'Own\ApiBundle\Document\Article') AND (data.publication = 'own')) AND
>> ((CONTAINS(data.categories, 'KURZ')) AND ((data.departmentSlugs =
>> 'international') AND (NOT (data.permissionPath like 'owns/%'))))) AND
>> (((data.title IS NOT NULL) AND (data.title <> '')) AND ((data.teaser IS
>> NOT NULL) AND ((data.teaser <> '') AND (ISDESCENDANTNODE(data,
>> [/article/2012/03/26])))))
>>      SQL2 JOIN right constraint: null
>> 2012-03-27 15:22:17.115 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:182    SQL2 JOIN execute: there are multiple inner
>> splits.
>> 2012-03-27 15:22:17.128 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 13 ms. selector:
>> [own:unstructured] AS data, columns: [data.jcr:primaryType], constraint:
>> (((data.[phpcr:class] = 'Own\ApiBundle\Document\Article') AND
>> (data.publication = 'own')) AND ((CONTAINS(data.categories, 'KURZ')) AND
>> (data.departmentSlugs = 'international'))) AND (((NOT
>> (data.permissionPath like 'owns/%')) AND (data.title IS NOT NULL)) AND
>> ((data.title <> '') AND ((data.teaser IS NOT NULL) AND (data.teaser <>
>> '')))), offset 0, limit -1
>> 2012-03-27 15:22:17.128 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:22:17.134 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:222       SQL2 JOIN LEFT SIDE took 18 ms. fetched 145
>> rows.
>> 2012-03-27 15:22:17.183 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 45 ms. selector:
>> [own:unstructured] AS referring, columns: [referring.jcr:primaryType],
>> constraint: (((((((referring.reference =
>> 'dabef043-d963-4c25-8b1b-d8db8335fc14') OR (referring.reference =
>> '360178d6-4d06-480e-99f5-9936e3d0285e')) OR ((referring.reference =
>> '64a72ae9-a5c0-45cb-85e1-f7cb403f851d') OR (referring.reference =
>> 'fb13c508-3751-43fd-b2b0-74bb52688f6a'))) OR (((referring.reference =
>> 'f3cb740d-0503-4cf7-b725-6ac2b071e627') OR (referring.reference =
>> 'e8896428-0a90-4f39-815e-2034f9821fed')) OR ((referring.reference =
>> '363032f7-4576-492c-9778-bad13de1b83e') OR ((referring.reference =
>> '9d3b1524-e1a9-4656-9efb-1734ae20d8c1') OR (referring.reference =
>> 'a3664b9c-feba-4b50-80c9-b15de8e00f0d'))))) OR ((((referring.reference =
>> '5626d03a-7056-4369-91c2-95674976954f') OR (referring.reference =
>> 'b0a8165c-647a-427b-baeb-6bb8095b2e25')) OR ((referring.reference =
>> '416b72c7-3d45-46ed-81f4-bb5665765e1f') OR (referring.reference =
>> 'e543b2fd-9606-4676-bea4-80dc6c0ecfdc'))) OR (((referring.reference =
>> '1b46f1bf-2121-492d-8886-b1271496a4e4') OR (referring.reference =
>> 'a71a5af1-41d0-4a9b-9590-7355bfb6c8fe')) OR ((referring.reference =
>> 'fc4448d5-6270-40d4-9a7e-ffaa32bbf0e4') OR ((referring.reference =
>> 'f6c49452-3a55-4bd0-929f-590652fbca62') OR (referring.reference =
>> '03fbc4a5-6fa1-442f-98c3-21e2c1626eab')))))) OR (((((referring.reference
>> = '11e8f268-7137-4c12-8a2c-d665fc9bc8c1') OR (referring.reference =
>> 'e6a7fb91-1a47-4c96-ab2b-d99e17fe1058')) OR ((referring.reference =
>> '3f590d84-3fdf-46c8-ba24-edff3c18d380') OR (referring.reference =
>> 'dd390426-71b9-442b-b21d-f781d6f92108'))) OR (((referring.reference =
>> '0553667e-8fd8-475d-9c37-aa32059d6ca3') OR (referring.reference =
>> '85a88a31-354b-484c-8cd8-49ff964b3a31')) OR ((referring.reference =
>> '5796b1a0-9a48-4684-bdcd-ca81a4a668b2') OR ((referring.reference =
>> '8c1556f5-a1ac-48b0-b378-9d49df208a06') OR (referring.reference =
>> 'cf3415c4-0eab-44d5-84f3-6cb81a95275f'))))) OR ((((referring.reference =
>> '52ae2f47-9e5f-4e6b-8f8a-b02db35ef4fb') OR (referring.reference =
>> '793a47e6-4903-46c5-9a4b-93942ac052b6')) OR ((referring.reference =
>> 'd1d18eab-749e-40aa-895a-669b7554f6ec') OR (referring.reference =
>> '14361658-a4d1-43af-a4b8-10f0cfdab623'))) OR (((referring.reference =
>> '3307515f-0943-481a-b87e-7c20f734536f') OR (referring.reference =
>> '1c72c6c1-eb29-4ace-9fde-e1372ee21a6a')) OR ((referring.reference =
>> '35c502cb-9456-4a1f-91ca-18a8057c0c72') OR ((referring.reference =
>> 'f3d7dd59-3a27-4a1e-b991-a28452695ed0') OR (referring.reference =
>> '5953a950-6def-4832-9db2-4641ede368ef'))))))) OR
>> ((((((referring.reference = '9c86d524-3ff2-4c10-95a2-449fb751711a') OR
>> (referring.reference = '22cf7cca-90cb-4f3f-b0ac-338f8da9c813')) OR
>> ((referring.reference = '302595c5-fce5-42ba-ba88-466a1d234458') OR
>> (referring.reference = 'a7fba88b-1f16-4ac2-91b5-3dfc2084ee7c'))) OR
>> (((referring.reference = 'd5b4f2e2-3232-402d-950e-88a27cc5944d') OR
>> (referring.reference = 'f5123108-19af-48ee-9922-90f9830486fc')) OR
>> ((referring.reference = '221554f2-a8b8-47c6-8466-71d79d3bd763') OR
>> ((referring.reference = '0ff48319-b415-43c6-aafa-8b56f8b556d9') OR
>> (referring.reference = 'c2839883-7fc0-439e-aba5-309cf95f0117'))))) OR
>> ((((referring.reference = 'c3c9ed93-a5c7-4a40-9f19-90595554da41') OR
>> (referring.reference = '356909e9-25f7-46c3-9a95-dcedfc583fe7')) OR
>> ((referring.reference = '770466bd-2917-433d-8106-2a00d4449a02') OR
>> (referring.reference = 'f8ebf6bb-a1b2-4334-af23-634e962cc2ca'))) OR
>> (((referring.reference = '75086103-ed01-4711-acb1-76f6f4305a28') OR
>> (referring.reference = '602f4c8d-99b1-45b7-9096-bc047097f840')) OR
>> ((referring.reference = 'd97de87a-a5c6-4a25-8c45-550d6bcd5cf2') OR
>> ((referring.reference = 'f1b31a93-bec1-4d55-bcd1-b5bbfdeffc8b') OR
>> (referring.reference = 'f7104878-40b5-4afb-90b0-64bdcbc39258')))))) OR
>> (((((referring.reference = '4509d2ed-f95f-45f3-adb6-3c60b28721a8') OR
>> (referring.reference = 'ea23a845-a744-41d3-8ccf-e18592f20c2c')) OR
>> ((referring.reference = '7a0837b6-989b-49f9-8d1b-7ba1bee66934') OR
>> (referring.reference = '705288d8-1ffd-4d90-b066-a503e046d009'))) OR
>> (((referring.reference = '8e693e6c-c29f-44aa-a734-0b94f4035995') OR
>> (referring.reference = 'e126b2f3-23d9-488e-a0b9-6c234b3fad71')) OR
>> ((referring.reference = '2c3e7ca8-92fa-4b0a-875d-1e3a9b6cc9ff') OR
>> ((referring.reference = '92eca2e3-cff0-4ec6-952a-bac3fa72befb') OR
>> (referring.reference = 'ceeb5abf-a47c-4a2d-b40b-246a5c979d05'))))) OR
>> ((((referring.reference = 'db2fc503-2685-437b-84ec-360bcdd25617') OR
>> (referring.reference = 'fb64a059-12a4-4204-86bc-3a484da14962')) OR
>> ((referring.reference = '8219a54b-25ed-4531-897b-1b7d98c86236') OR
>> (referring.reference = '66272d61-d4e9-48d1-88c4-853d8337cc37'))) OR
>> (((referring.reference = '486bd99d-e20d-413e-b7a5-65bb8c0a70f2') OR
>> (referring.reference = '7c75e0cc-27d9-4979-8c10-04bcf68786a4')) OR
>> ((referring.reference = 'b3ff705b-e5b9-4d96-9263-b8e5f7a7c9e4') OR
>> ((referring.reference = 'b509f992-a8d2-4249-906b-f0f589781f12') OR
>> (referring.reference = '422c0683-e785-43a5-8128-1de3f08348aa')))))))) OR
>> (((((((referring.reference = '970f35bd-e8d3-49fc-8e63-264bb395fba7') OR
>> (referring.reference = '1dcc2ad7-c0e9-48f8-83c4-e31c2bf272df')) OR
>> ((referring.reference = '43ae876f-1307-4c4e-8d2b-8ebe781f775b') OR
>> (referring.reference = '4ac9e304-15e3-4b19-8406-51a39bfdcc6a'))) OR
>> (((referring.reference = 'bf0c9f9d-43de-4aa3-9177-bd6ad6dabf0d') OR
>> (referring.reference = '4627e7bd-175d-4680-8b18-9856145534be')) OR
>> ((referring.reference = 'd3e16650-29f2-4681-9fb3-2be83ae7adb2') OR
>> ((referring.reference = 'a6859cb7-3f9f-49f5-9d6f-47246c484eec') OR
>> (referring.reference = '2974618a-bbb6-4bae-a0cb-e3e82babee05'))))) OR
>> ((((referring.reference = 'ab4cc140-2c48-432e-986b-af9536c3809d') OR
>> (referring.reference = '543987d1-c6fa-47e2-86db-b0926323edd0')) OR
>> ((referring.reference = '7f9149d2-bdc7-4394-9efe-aa3cd1ac201c') OR
>> (referring.reference = 'd5fcf8f1-a06d-42ee-a9ff-7b778457d56c'))) OR
>> (((referring.reference = 'f9ff49ca-dc3a-4820-a421-2d41cd4b5083') OR
>> (referring.reference = 'a18ac7c1-e100-444a-8d50-1631ac900a76')) OR
>> ((referring.reference = '417bf61c-696e-4a18-8792-1353ebd3800e') OR
>> ((referring.reference = '7ce8a1d4-62cd-4e66-bcf0-f6fd3276c767') OR
>> (referring.reference = '3be4cf2c-00a5-4f19-a846-925c02c4e6a2')))))) OR
>> (((((referring.reference = '70afe4aa-0ff9-4336-a030-f6d17b631865') OR
>> (referring.reference = '48d84382-b251-484d-a061-b2f3acc940f1')) OR
>> ((referring.reference = 'c2d2c2fd-4a37-4542-9cf2-0ab2ee85f56c') OR
>> (referring.reference = 'dc1972a8-30fa-4194-8640-bfc1d15b3226'))) OR
>> (((referring.reference = '10f1b4c7-2fbd-4d37-8765-324c22c1eb78') OR
>> (referring.reference = 'f5878662-8b75-4b56-9bf2-ddad05863b6b')) OR
>> ((referring.reference = 'dde13542-d444-445c-a260-735f44e1c5a5') OR
>> ((referring.reference = 'ee668110-7983-4f78-85bf-83396544a995') OR
>> (referring.reference = 'd5fddf5b-75c4-43a1-9f66-6b2bd1642b1d'))))) OR
>> ((((referring.reference = 'a7e08817-4da5-450a-8883-642358cbdee6') OR
>> (referring.reference = '7247e111-1096-43d2-a842-12194199f73f')) OR
>> ((referring.reference = 'ef8e1445-6995-4955-852f-7e8171f69dd5') OR
>> (referring.reference = 'e56b971d-5217-4677-8cd3-d9aed2e27868'))) OR
>> (((referring.reference = '4b167857-8f64-443d-96d5-d4b0f9230f8f') OR
>> (referring.reference = '56474a02-ef78-48da-bbda-a3976b766e82')) OR
>> ((referring.reference = 'dd45ab8c-aaee-48c0-88f2-1ebbc07d0ef4') OR
>> ((referring.reference = 'b5c6e3be-9a3e-4225-88a9-db73279f3bea') OR
>> (referring.reference = '759204cc-95e0-47c7-a353-0aa07f2925bc'))))))) OR
>> ((((((referring.reference = 'fad5544c-25cd-4d40-9780-a640cff4c34a') OR
>> (referring.reference = 'e805d4b0-eef1-4902-a57c-714eacf98aec')) OR
>> ((referring.reference = '32e12819-f842-4218-a081-73268e0248af') OR
>> (referring.reference = 'dd926ef4-66de-4268-b7a7-9dd22dc7822e'))) OR
>> (((referring.reference = 'fb1f114e-5d41-419f-b1d6-469b52584d8c') OR
>> (referring.reference = 'f0f81bf2-2936-4ad0-bd06-b8f77c08082b')) OR
>> ((referring.reference = 'a8e465b0-6ac3-4c71-9c05-0d0db5d4ed95') OR
>> ((referring.reference = '07ad03ad-22b2-4516-9ceb-4828799fa7d0') OR
>> (referring.reference = '85c7119b-05ff-462c-953e-8f7d204fbcc7'))))) OR
>> ((((referring.reference = '7a9a7382-3f09-4b16-a7f7-8891936f89d3') OR
>> (referring.reference = '494e2684-dd23-4ad0-b877-45072d5dabb0')) OR
>> ((referring.reference = 'f75fbcb6-756d-4289-b552-05e11ff724e8') OR
>> (referring.reference = '5f584bd6-178b-47ef-8a95-aef199221b70'))) OR
>> (((referring.reference = '30a56660-eadc-43db-b689-69390dacadf3') OR
>> (referring.reference = 'c5ef124c-955d-473a-9592-924ebeaf4cc0')) OR
>> ((referring.reference = 'aedf8dee-44f5-44aa-8b94-0f0811487c24') OR
>> ((referring.reference = 'f07e2d32-ced6-418c-80cd-473cdae38b9f') OR
>> (referring.reference = '7def13bb-e269-48dd-aebe-874fd1504776')))))) OR
>> (((((referring.reference = '73906c23-27fd-424d-84b5-677ee5528e7a') OR
>> (referring.reference = '7fb03b21-3dd1-42bc-8d66-81c5c8df4ba6')) OR
>> ((referring.reference = 'dc129f72-7fae-45fe-89cf-c5d7754a23a8') OR
>> (referring.reference = 'fa8c042f-055c-4453-942f-e6cd489fa0e4'))) OR
>> (((referring.reference = '04dea2e3-8a18-4ab0-9d38-a506d53be0cf') OR
>> (referring.reference = '18eb65d7-2e8b-4935-bb1b-4b7c493f9dea')) OR
>> ((referring.reference = '4c7171cb-caae-4747-9e44-0f01e8300b01') OR
>> ((referring.reference = '4db5ac73-2277-4be2-9fc0-f407d0aa4a90') OR
>> (referring.reference = '764811a0-5c44-4c9c-8162-5be67a046771'))))) OR
>> ((((referring.reference = '400f0efa-c1d2-416b-82f2-e5208e1152b1') OR
>> (referring.reference = '1fa1d92a-4af1-4db6-8bd7-ad38b762ae72')) OR
>> ((referring.reference = '6b3a9b45-040f-49a1-ba64-e13d5433b74e') OR
>> ((referring.reference = '9be29c73-8164-4be0-8b5f-34e889718a89') OR
>> (referring.reference = '9f72cac4-3fb6-456b-9a8d-77a391d48cbb')))) OR
>> (((referring.reference = '3c6d886e-9fb3-4080-b633-c1e1120b9da1') OR
>> (referring.reference = 'e2166375-5bf1-432e-a348-6cf40d97c6ae')) OR
>> ((referring.reference = '9d458e27-fbf3-4595-8739-61ec17d428c5') OR
>> ((referring.reference = '3e8da13a-e971-4720-be22-f6cb859b1b5b') OR
>> (referring.reference = '36b33131-03a7-46ed-987c-2d03c20cfe92')))))))),
>> offset 0, limit -1
>> 2012-03-27 15:22:17.184 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:22:17.200 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 14 ms. selector:
>> [own:unstructured] AS referring, columns: [referring.jcr:primaryType],
>> constraint: ((((((((referring.reference =
>> 'dabef043-d963-4c25-8b1b-d8db8335fc14') OR (referring.reference =
>> '360178d6-4d06-480e-99f5-9936e3d0285e')) OR ((referring.reference =
>> '64a72ae9-a5c0-45cb-85e1-f7cb403f851d') OR (referring.reference =
>> 'fb13c508-3751-43fd-b2b0-74bb52688f6a'))) OR (((referring.reference =
>> 'f3cb740d-0503-4cf7-b725-6ac2b071e627') OR (referring.reference =
>> 'e8896428-0a90-4f39-815e-2034f9821fed')) OR ((referring.reference =
>> '363032f7-4576-492c-9778-bad13de1b83e') OR ((referring.reference =
>> '9d3b1524-e1a9-4656-9efb-1734ae20d8c1') OR (referring.reference =
>> 'a3664b9c-feba-4b50-80c9-b15de8e00f0d'))))) OR ((((referring.reference =
>> '5626d03a-7056-4369-91c2-95674976954f') OR (referring.reference =
>> 'b0a8165c-647a-427b-baeb-6bb8095b2e25')) OR ((referring.reference =
>> '416b72c7-3d45-46ed-81f4-bb5665765e1f') OR (referring.reference =
>> 'e543b2fd-9606-4676-bea4-80dc6c0ecfdc'))) OR (((referring.reference =
>> '1b46f1bf-2121-492d-8886-b1271496a4e4') OR (referring.reference =
>> 'a71a5af1-41d0-4a9b-9590-7355bfb6c8fe')) OR ((referring.reference =
>> 'fc4448d5-6270-40d4-9a7e-ffaa32bbf0e4') OR ((referring.reference =
>> 'f6c49452-3a55-4bd0-929f-590652fbca62') OR (referring.reference =
>> '03fbc4a5-6fa1-442f-98c3-21e2c1626eab')))))) OR (((((referring.reference
>> = '11e8f268-7137-4c12-8a2c-d665fc9bc8c1') OR (referring.reference =
>> 'e6a7fb91-1a47-4c96-ab2b-d99e17fe1058')) OR ((referring.reference =
>> '3f590d84-3fdf-46c8-ba24-edff3c18d380') OR (referring.reference =
>> 'dd390426-71b9-442b-b21d-f781d6f92108'))) OR (((referring.reference =
>> '0553667e-8fd8-475d-9c37-aa32059d6ca3') OR (referring.reference =
>> '85a88a31-354b-484c-8cd8-49ff964b3a31')) OR ((referring.reference =
>> '5796b1a0-9a48-4684-bdcd-ca81a4a668b2') OR ((referring.reference =
>> '8c1556f5-a1ac-48b0-b378-9d49df208a06') OR (referring.reference =
>> 'cf3415c4-0eab-44d5-84f3-6cb81a95275f'))))) OR ((((referring.reference =
>> '52ae2f47-9e5f-4e6b-8f8a-b02db35ef4fb') OR (referring.reference =
>> '793a47e6-4903-46c5-9a4b-93942ac052b6')) OR ((referring.reference =
>> 'd1d18eab-749e-40aa-895a-669b7554f6ec') OR (referring.reference =
>> '14361658-a4d1-43af-a4b8-10f0cfdab623'))) OR (((referring.reference =
>> '3307515f-0943-481a-b87e-7c20f734536f') OR (referring.reference =
>> '1c72c6c1-eb29-4ace-9fde-e1372ee21a6a')) OR ((referring.reference =
>> '35c502cb-9456-4a1f-91ca-18a8057c0c72') OR ((referring.reference =
>> 'f3d7dd59-3a27-4a1e-b991-a28452695ed0') OR (referring.reference =
>> '5953a950-6def-4832-9db2-4641ede368ef'))))))) OR
>> ((((((referring.reference = '9c86d524-3ff2-4c10-95a2-449fb751711a') OR
>> (referring.reference = '22cf7cca-90cb-4f3f-b0ac-338f8da9c813')) OR
>> ((referring.reference = '302595c5-fce5-42ba-ba88-466a1d234458') OR
>> (referring.reference = 'a7fba88b-1f16-4ac2-91b5-3dfc2084ee7c'))) OR
>> (((referring.reference = 'd5b4f2e2-3232-402d-950e-88a27cc5944d') OR
>> (referring.reference = 'f5123108-19af-48ee-9922-90f9830486fc')) OR
>> ((referring.reference = '221554f2-a8b8-47c6-8466-71d79d3bd763') OR
>> ((referring.reference = '0ff48319-b415-43c6-aafa-8b56f8b556d9') OR
>> (referring.reference = 'c2839883-7fc0-439e-aba5-309cf95f0117'))))) OR
>> ((((referring.reference = 'c3c9ed93-a5c7-4a40-9f19-90595554da41') OR
>> (referring.reference = '356909e9-25f7-46c3-9a95-dcedfc583fe7')) OR
>> ((referring.reference = '770466bd-2917-433d-8106-2a00d4449a02') OR
>> (referring.reference = 'f8ebf6bb-a1b2-4334-af23-634e962cc2ca'))) OR
>> (((referring.reference = '75086103-ed01-4711-acb1-76f6f4305a28') OR
>> (referring.reference = '602f4c8d-99b1-45b7-9096-bc047097f840')) OR
>> ((referring.reference = 'd97de87a-a5c6-4a25-8c45-550d6bcd5cf2') OR
>> ((referring.reference = 'f1b31a93-bec1-4d55-bcd1-b5bbfdeffc8b') OR
>> (referring.reference = 'f7104878-40b5-4afb-90b0-64bdcbc39258')))))) OR
>> (((((referring.reference = '4509d2ed-f95f-45f3-adb6-3c60b28721a8') OR
>> (referring.reference = 'ea23a845-a744-41d3-8ccf-e18592f20c2c')) OR
>> ((referring.reference = '7a0837b6-989b-49f9-8d1b-7ba1bee66934') OR
>> (referring.reference = '705288d8-1ffd-4d90-b066-a503e046d009'))) OR
>> (((referring.reference = '8e693e6c-c29f-44aa-a734-0b94f4035995') OR
>> (referring.reference = 'e126b2f3-23d9-488e-a0b9-6c234b3fad71')) OR
>> ((referring.reference = '2c3e7ca8-92fa-4b0a-875d-1e3a9b6cc9ff') OR
>> ((referring.reference = '92eca2e3-cff0-4ec6-952a-bac3fa72befb') OR
>> (referring.reference = 'ceeb5abf-a47c-4a2d-b40b-246a5c979d05'))))) OR
>> ((((referring.reference = 'db2fc503-2685-437b-84ec-360bcdd25617') OR
>> (referring.reference = 'fb64a059-12a4-4204-86bc-3a484da14962')) OR
>> ((referring.reference = '8219a54b-25ed-4531-897b-1b7d98c86236') OR
>> (referring.reference = '66272d61-d4e9-48d1-88c4-853d8337cc37'))) OR
>> (((referring.reference = '486bd99d-e20d-413e-b7a5-65bb8c0a70f2') OR
>> (referring.reference = '7c75e0cc-27d9-4979-8c10-04bcf68786a4')) OR
>> ((referring.reference = 'b3ff705b-e5b9-4d96-9263-b8e5f7a7c9e4') OR
>> ((referring.reference = 'b509f992-a8d2-4249-906b-f0f589781f12') OR
>> (referring.reference = '422c0683-e785-43a5-8128-1de3f08348aa')))))))) OR
>> (((((((referring.reference = '970f35bd-e8d3-49fc-8e63-264bb395fba7') OR
>> (referring.reference = '1dcc2ad7-c0e9-48f8-83c4-e31c2bf272df')) OR
>> ((referring.reference = '43ae876f-1307-4c4e-8d2b-8ebe781f775b') OR
>> (referring.reference = '4ac9e304-15e3-4b19-8406-51a39bfdcc6a'))) OR
>> (((referring.reference = 'bf0c9f9d-43de-4aa3-9177-bd6ad6dabf0d') OR
>> (referring.reference = '4627e7bd-175d-4680-8b18-9856145534be')) OR
>> ((referring.reference = 'd3e16650-29f2-4681-9fb3-2be83ae7adb2') OR
>> ((referring.reference = 'a6859cb7-3f9f-49f5-9d6f-47246c484eec') OR
>> (referring.reference = '2974618a-bbb6-4bae-a0cb-e3e82babee05'))))) OR
>> ((((referring.reference = 'ab4cc140-2c48-432e-986b-af9536c3809d') OR
>> (referring.reference = '543987d1-c6fa-47e2-86db-b0926323edd0')) OR
>> ((referring.reference = '7f9149d2-bdc7-4394-9efe-aa3cd1ac201c') OR
>> (referring.reference = 'd5fcf8f1-a06d-42ee-a9ff-7b778457d56c'))) OR
>> (((referring.reference = 'f9ff49ca-dc3a-4820-a421-2d41cd4b5083') OR
>> (referring.reference = 'a18ac7c1-e100-444a-8d50-1631ac900a76')) OR
>> ((referring.reference = '417bf61c-696e-4a18-8792-1353ebd3800e') OR
>> ((referring.reference = '7ce8a1d4-62cd-4e66-bcf0-f6fd3276c767') OR
>> (referring.reference = '3be4cf2c-00a5-4f19-a846-925c02c4e6a2')))))) OR
>> (((((referring.reference = '70afe4aa-0ff9-4336-a030-f6d17b631865') OR
>> (referring.reference = '48d84382-b251-484d-a061-b2f3acc940f1')) OR
>> ((referring.reference = 'c2d2c2fd-4a37-4542-9cf2-0ab2ee85f56c') OR
>> (referring.reference = 'dc1972a8-30fa-4194-8640-bfc1d15b3226'))) OR
>> (((referring.reference = '10f1b4c7-2fbd-4d37-8765-324c22c1eb78') OR
>> (referring.reference = 'f5878662-8b75-4b56-9bf2-ddad05863b6b')) OR
>> ((referring.reference = 'dde13542-d444-445c-a260-735f44e1c5a5') OR
>> ((referring.reference = 'ee668110-7983-4f78-85bf-83396544a995') OR
>> (referring.reference = 'd5fddf5b-75c4-43a1-9f66-6b2bd1642b1d'))))) OR
>> ((((referring.reference = 'a7e08817-4da5-450a-8883-642358cbdee6') OR
>> (referring.reference = '7247e111-1096-43d2-a842-12194199f73f')) OR
>> ((referring.reference = 'ef8e1445-6995-4955-852f-7e8171f69dd5') OR
>> (referring.reference = 'e56b971d-5217-4677-8cd3-d9aed2e27868'))) OR
>> (((referring.reference = '4b167857-8f64-443d-96d5-d4b0f9230f8f') OR
>> (referring.reference = '56474a02-ef78-48da-bbda-a3976b766e82')) OR
>> ((referring.reference = 'dd45ab8c-aaee-48c0-88f2-1ebbc07d0ef4') OR
>> ((referring.reference = 'b5c6e3be-9a3e-4225-88a9-db73279f3bea') OR
>> (referring.reference = '759204cc-95e0-47c7-a353-0aa07f2925bc'))))))) OR
>> ((((((referring.reference = 'fad5544c-25cd-4d40-9780-a640cff4c34a') OR
>> (referring.reference = 'e805d4b0-eef1-4902-a57c-714eacf98aec')) OR
>> ((referring.reference = '32e12819-f842-4218-a081-73268e0248af') OR
>> (referring.reference = 'dd926ef4-66de-4268-b7a7-9dd22dc7822e'))) OR
>> (((referring.reference = 'fb1f114e-5d41-419f-b1d6-469b52584d8c') OR
>> (referring.reference = 'f0f81bf2-2936-4ad0-bd06-b8f77c08082b')) OR
>> ((referring.reference = 'a8e465b0-6ac3-4c71-9c05-0d0db5d4ed95') OR
>> ((referring.reference = '07ad03ad-22b2-4516-9ceb-4828799fa7d0') OR
>> (referring.reference = '85c7119b-05ff-462c-953e-8f7d204fbcc7'))))) OR
>> ((((referring.reference = '7a9a7382-3f09-4b16-a7f7-8891936f89d3') OR
>> (referring.reference = '494e2684-dd23-4ad0-b877-45072d5dabb0')) OR
>> ((referring.reference = 'f75fbcb6-756d-4289-b552-05e11ff724e8') OR
>> (referring.reference = '5f584bd6-178b-47ef-8a95-aef199221b70'))) OR
>> (((referring.reference = '30a56660-eadc-43db-b689-69390dacadf3') OR
>> (referring.reference = 'c5ef124c-955d-473a-9592-924ebeaf4cc0')) OR
>> ((referring.reference = 'aedf8dee-44f5-44aa-8b94-0f0811487c24') OR
>> ((referring.reference = 'f07e2d32-ced6-418c-80cd-473cdae38b9f') OR
>> (referring.reference = '7def13bb-e269-48dd-aebe-874fd1504776')))))) OR
>> (((((referring.reference = '73906c23-27fd-424d-84b5-677ee5528e7a') OR
>> (referring.reference = '7fb03b21-3dd1-42bc-8d66-81c5c8df4ba6')) OR
>> ((referring.reference = 'dc129f72-7fae-45fe-89cf-c5d7754a23a8') OR
>> (referring.reference = 'fa8c042f-055c-4453-942f-e6cd489fa0e4'))) OR
>> (((referring.reference = '04dea2e3-8a18-4ab0-9d38-a506d53be0cf') OR
>> (referring.reference = '18eb65d7-2e8b-4935-bb1b-4b7c493f9dea')) OR
>> ((referring.reference = '4c7171cb-caae-4747-9e44-0f01e8300b01') OR
>> ((referring.reference = '4db5ac73-2277-4be2-9fc0-f407d0aa4a90') OR
>> (referring.reference = '764811a0-5c44-4c9c-8162-5be67a046771'))))) OR
>> ((((referring.reference = '400f0efa-c1d2-416b-82f2-e5208e1152b1') OR
>> (referring.reference = '1fa1d92a-4af1-4db6-8bd7-ad38b762ae72')) OR
>> ((referring.reference = '6b3a9b45-040f-49a1-ba64-e13d5433b74e') OR
>> ((referring.reference = '9be29c73-8164-4be0-8b5f-34e889718a89') OR
>> (referring.reference = '9f72cac4-3fb6-456b-9a8d-77a391d48cbb')))) OR
>> (((referring.reference = '3c6d886e-9fb3-4080-b633-c1e1120b9da1') OR
>> (referring.reference = 'e2166375-5bf1-432e-a348-6cf40d97c6ae')) OR
>> ((referring.reference = '9d458e27-fbf3-4595-8739-61ec17d428c5') OR
>> ((referring.reference = '3e8da13a-e971-4720-be22-f6cb859b1b5b') OR
>> (referring.reference = '36b33131-03a7-46ed-987c-2d03c20cfe92')))))))))
>> AND ((referring.reference IS NOT NULL) AND (ISDESCENDANTNODE(referring,
>> [/article/2012/03/26]))), offset 0, limit -1
>> 2012-03-27 15:22:17.201 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:22:17.201 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:261       SQL2 JOIN RIGHT SIDE took 67 ms. fetched 0
>> rows.
>> 2012-03-27 15:22:17.202 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:197    SQL2 JOIN executed first branch, took 87 ms.
>> 2012-03-27 15:22:17.214 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 11 ms. selector:
>> [own:unstructured] AS data, columns: [data.jcr:primaryType], constraint:
>> (((data.[phpcr:class] = 'Own\ApiBundle\Document\Article') AND
>> (data.publication = 'own')) AND ((CONTAINS(data.categories, 'KURZ')) AND
>> ((data.departmentSlugs = 'international') AND (NOT (data.permissionPath
>> like 'owns/%'))))) AND (((data.title IS NOT NULL) AND (data.title <>
>> '')) AND ((data.teaser IS NOT NULL) AND ((data.teaser <> '') AND
>> (ISDESCENDANTNODE(data, [/article/2012/03/26]))))), offset 0, limit -1
>> 2012-03-27 15:22:17.214 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:22:17.215 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:222       SQL2 JOIN LEFT SIDE took 13 ms. fetched 7 rows.
>> 2012-03-27 15:22:17.218 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:465           SQL2 SELECT took 3 ms. selector:
>> [own:unstructured] AS referring, columns: [referring.jcr:primaryType],
>> constraint: ((referring.reference =
>> '221554f2-a8b8-47c6-8466-71d79d3bd763') OR ((referring.reference =
>> '07ad03ad-22b2-4516-9ceb-4828799fa7d0') OR (referring.reference =
>> '85c7119b-05ff-462c-953e-8f7d204fbcc7'))) OR (((referring.reference =
>> '6b3a9b45-040f-49a1-ba64-e13d5433b74e') OR (referring.reference =
>> 'dc129f72-7fae-45fe-89cf-c5d7754a23a8')) OR ((referring.reference =
>> '75086103-ed01-4711-acb1-76f6f4305a28') OR (referring.reference =
>> 'f1b31a93-bec1-4d55-bcd1-b5bbfdeffc8b'))), offset 0, limit -1
>> 2012-03-27 15:22:17.218 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:480           SQL2 SORT took 0 ms.
>> 2012-03-27 15:22:17.219 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:261       SQL2 JOIN RIGHT SIDE took 4 ms. fetched 0 rows.
>> 2012-03-27 15:22:17.220 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:211    SQL2 JOIN executed second branch, took 18 ms.
>> 2012-03-27 15:22:17.221 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:168     SQL2 SORT took 0 ms.
>> 2012-03-27 15:22:17.222 DEBUG [606360852@qtp-1418257117-3]
>> QueryEngine.java:117 SQL2 QUERY execute took 107 ms. native sort is false.
>>
>> obviously some difference ;)
>>
>> chregu
>>
>>
>>
>> On 27.03.12 13:30, Alex Parvulescu wrote:
>> > Hi Christian,
>> >
>> > can you enable debug logs
>> > on org.apache.jackrabbit.core.query.lucene.join.QueryEngine?
>> > I'm curious to see what the constraits look like in the big query vs the
>> > 2 small ones.
>> >
>> > This also goes for the join you've mentioned later in the thread, but I
>> > just wanted to start with the first query ;)
>> >
>> > alex
>> >
>> > On Tue, Mar 27, 2012 at 9:55 AM, Christian Stocker
>> > <christian.stocker@liip.ch <mailto:christian.stocker@liip.ch>> wrote:
>> >
>> >     Hi
>> >
>> >     On 27.03.12 09:49, David Buchmann wrote:
>> >     > sorry, my bad. did not read correctly.
>> >     > you do have the paranthesis so you did what you wanted to do.
>> >     >
>> >     > looks like lucene/jackrabbit combine the 2 datasets first and
>> filter
>> >     > later...
>> >     >
>> >     > what if you try
>> >     >
>> >     >
>> >     > SELECT * FROM [own:unstructured] AS data
>> >     > WHERE
>> >     >     data.guid = 'J7B1X' AND ISDESCENDANTNODE(data, '/article')
>> >     >   OR
>> >     >     data.guid = 'J7B1X' AND ISDESCENDANTNODE(data,
>> '/import/article')
>> >     > ORDER BY firstImportDate DESC
>> >
>> >     I tried that and I tried it again now. Same response time as the
>> >     original query.
>> >
>> >     Any hints from someone who knows the internal workings of
>> >     jackrabbit/lucene?
>> >
>> >     chregu
>> >
>> >     >
>> >     > if this is fast, then the jackrabbit query engine is not very
>> >     clever...
>> >     >
>> >     > cheers,david
>> >     >
>> >     >
>> >     > Am 27.03.2012 09:10, schrieb David Buchmann:
>> >     >> i think the 2 queries are not equivalent. the first one is
>> >     equivalent to
>> >     >
>> >     >> ...
>> >     >> WHERE data.guid = 'J7B1X'
>> >     >>   AND (ISDESCENDANTNODE(data, '/article')
>> >     >
>> >     >> plus
>> >     >
>> >     >> WHERE
>> >     >>  ISDESCENDANTNODE(data, '/import/article')
>> >     >
>> >     >> (if you want the data.guid = ... to apply to both, you need
>> >     paranthesis)
>> >     >
>> >     >> but if /import/article is almost empty, i still don't see why the
>> >     >> combined query should take so long unless jackrabbit/lucene are
>> doing
>> >     >> something stupid.
>> >     >
>> >     >> cheers,david
>> >     >
>> >     >> Am 26.03.2012 22:28, schrieb Christian Stocker:
>> >     >>> Hi
>> >     >
>> >     >>> We have the following search query
>> >     >
>> >     >
>> >     >>> SELECT * FROM [own:unstructured] AS data WHERE data.guid =
>> 'J7B1X'
>> >     >>>             AND (ISDESCENDANTNODE(data, '/article')
>> >     >>>             OR ISDESCENDANTNODE(data, '/import/article')
>> >     >>>             )
>> >     >>>             ORDER BY firstImportDate DESC
>> >     >
>> >     >
>> >     >>> This query can take quite some time (up to 3 seconds, but it
>> >     gets more
>> >     >>> and more hte more data we have). In /article there's potentially
>> >     a lot
>> >     >>> of nodes, in /import/article usually almost nil.
>> >     >
>> >     >
>> >     >>> If we now separate the query into 2:
>> >     >
>> >     >>> SELECT * FROM [own:unstructured] AS data WHERE data.guid =
>> 'J7B1X'
>> >     >>>             AND ISDESCENDANTNODE(data, '/article')
>> >     >>>             ORDER BY firstImportDate DESC
>> >     >
>> >     >>> and
>> >     >
>> >     >>> SELECT * FROM [own:unstructured] AS data WHERE data.guid =
>> 'J7B1X'
>> >     >>>             AND ISDESCENDANTNODE(data, '/import/article')
>> >     >>>             ORDER BY firstImportDate DESC
>> >     >
>> >     >>> Both queries take approx. 10ms (and return 0 or 1 resultset,
>> >     more is not
>> >     >>> possible). So quite fast.
>> >     >
>> >     >>> Can anyone explain to me, why that is and how we could rewrite
>> >     the query
>> >     >>> to make it fast with a single one as well?
>> >     >
>> >     >>> Thanks
>> >     >
>> >     >>> chregu
>> >     >
>> >     >
>> >
>> >
>>
>> --
>> Liip AG  //  Feldstrasse 133 //  CH-8004 Zurich
>> Tel +41 43 500 39 81 // Mobile +41 76 561 88 60
>> www.liip.ch // blog.liip.ch // GnuPG 0x0748D5FE
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message