Compiling: - pre-evaluating fn:collection("ALL-CDIS") - pre-evaluating ("ALKY", "AYMD") - rewriting ((db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal >= "13.708333") - rewriting ((db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal <= "15.708333") - rewriting ((db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal >= "45.6976667") - rewriting ((db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal <= "55.6976667") - pre-evaluating "2012-03-30T09:07:00" cast as xs:dateTime - atomic evaluation of (fn:string($x_0/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition) cast as xs:dateTime >= "2012-03-30T09:07:00") - pre-evaluating "2012-04-30T09:07:00" cast as xs:dateTime - atomic evaluation of (fn:string($x_0/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition) cast as xs:dateTime <= "2012-04-30T09:07:00") - removing context expression (.) - removing context expression (.) - atomic evaluation of (fn:string(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition) cast as xs:dateTime >= "2012-03-30T09:07:00") - removing context expression (.) - atomic evaluation of (fn:string(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition) cast as xs:dateTime <= "2012-04-30T09:07:00") - removing context expression (.) - removing context expression (.) - removing context expression (.) - removing context expression (.) - removing context expression (.) - rewriting where clause(s) Query: xquery version "3.0"; declare namespace gco = "http://www.isotc211.org/2005/gco"; declare namespace gmd = "http://www.isotc211.org/2005/gmd"; declare namespace gml = "http://www.opengis.net/gml"; declare namespace gmx="http://www.isotc211.org/2005/gmx"; declare namespace sdn = "http://www.seadatanet.org"; declare namespace fn = "http://www.w3.org/2005/xpath-functions"; declare namespace xs = "http://www.w3.org/2001/XMLSchema"; for $x in collection("ALL-CDIS") where $x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:descriptiveKeywords[*]/gmd:MD_Keywords/gmd:keyword[*]/sdn:SDN_ParameterDiscoveryCode/@codeListValue = ("ALKY","AYMD") and /gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal >= "13.708333" and /gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal <= "15.708333" and /gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal >= "45.6976667" and /gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal <= "55.6976667" and xs:dateTime(string($x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition)) >= xs:dateTime("2012-03-30T09:07:00") and xs:dateTime(string($x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition)) <= xs:dateTime("2012-04-30T09:07:00") and $x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:descriptiveKeywords[*]/gmd:MD_Keywords/gmd:keyword/sdn:SDN_DeviceCategoryCode/@codeListValue = 130 and $x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:descriptiveKeywords[*]/gmd:MD_Keywords/gmd:keyword/sdn:SDN_EDMERPCode/@codeListValue = 7827 and $x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:organisationName/sdn:SDN_EDMOCode/@codeListValue = 120 and $x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode/@codeListValue="originator" and $x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:resourceConstraints[*]/gmd:MD_LegalConstraints/gmd:otherConstraints/gmx:Anchor/text() = "unrestricted" order by string($x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString) return string($x/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString) Optimized Query: if(((db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/gco:Decimal <= "15.708333" and "45.6976667" <= (db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/gco:Decimal and (db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/gco:Decimal <= "55.6976667" and "13.708333" <= (db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/gco:Decimal)) then for $x_0 in (db:open-pre("ALL-CDIS",0), db:open-pre("ALL-CDIS",747), ...)[(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:descriptiveKeywords[*]/gmd:MD_Keywords/gmd:keyword[*]/sdn:SDN_ParameterDiscoveryCode/@codeListValue = ("ALKY", "AYMD"))][(fn:string(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition) cast as xs:dateTime >= "2012-03-30T09:07:00")][(fn:string(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition) cast as xs:dateTime <= "2012-04-30T09:07:00")][(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:descriptiveKeywords[*]/gmd:MD_Keywords/gmd:keyword/sdn:SDN_DeviceCategoryCode/@codeListValue = 130)][(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:descriptiveKeywords[*]/gmd:MD_Keywords/gmd:keyword/sdn:SDN_EDMERPCode/@codeListValue = 7827)][(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:organisationName/sdn:SDN_EDMOCode/@codeListValue = 120)][(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty/gmd:role/gmd:CI_RoleCode/@codeListValue = "originator")][(gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:resourceConstraints[*]/gmd:MD_LegalConstraints/gmd:otherConstraints/gmx:Anchor/text() = "unrestricted")] order by fn:string($x_0/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString) empty least return fn:string($x_0/gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString) else () Result: - Hit(s): 1 Item - Updated: 0 Items - Printed: 6 Bytes - Read Locking: local [ALL-CDIS] - Write Locking: none Timing: - Parsing: 1.6 ms - Compiling: 3.97 ms - Evaluating: 39518.62 ms - Printing: 1.92 ms - Total Time: 39526.11 ms Query plan: