Skip to content

unexpected out of memory allocation #187

@egonw

Description

@egonw

If I start with the following SPARQL:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX wd: <http://www.wikidata.org/entity/>

SELECT * WHERE {
  wd:Q773449 ?propp ?statement .
  ?statement a wikibase:BestRank ;
    ?proppsv [ wikibase:quantityAmount ?value ; wikibase:quantityUnit ?units ] .
}

This returns 8 statements:

Image

However, when I add an OPTIONAL line:

SELECT * WHERE {
  wd:Q773449 ?propp ?statement .
  ?statement a wikibase:BestRank ;
    ?proppsv [ wikibase:quantityAmount ?value ; wikibase:quantityUnit ?units ] .
  OPTIONAL { ?statement prov:wasDerivedFrom/pr:P248 ?source_ . OPTIONAL { ?source_ wdt:P356 ?doi_ . } }
}

... it tries to allocate multiple GBs of memory, which does not seem needed:

Image

Or am I doing something silly here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions