Tziavelis, NikolaosNikolaosTziavelisAjwani, DeepakDeepakAjwaniGatterbauer, WolfgangWolfgangGatterbaueret al,et al2023-11-282023-11-282020 ACM2020-05-01Proceedings of the VLDB Endowment2150-8097http://hdl.handle.net/10197/25061We study ranked enumeration of join-query results according to very general orders defined by selective dioids. Our main contribution is a framework for ranked enumeration over a class of dynamic programming problems that generalizes seemingly different problems that had been studied in isolation. To this end, we extend classic algorithms that find the k-shortest paths in a weighted graph. For full conjunctive queries, including cyclic ones, our approach is optimal in terms of the time to return the top result and the delay between results. These optimality properties are derived for the widely used notion of data complexity, which treats query size as a constant. By performing a careful cost analysis, we are able to uncover a previously unknown tradeo ff between two incomparable enumeration approaches: one has lower complexity when the number of returned results is small, the other when the number is very large. We theoretically and empirically demonstrate the superiority of our techniques over batch algorithms, which produce the full result and then sort it. Our technique is not only faster for returning the first few results, but on some inputs beats the batch algorithm even when all results are produced.en© ACM, 2020. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in Proceedings of the VLDB Endowment, {13, I9, (2020)} http://doi.acm.org/10.14778/3397230.3397250Conjunctive query evaluationRelational databasesGraph databasesRanked enumeration problemOptimal algorithms for ranked enumeration of answers to full conjunctive queriesJournal Article1391582159710.14778/3397230.33972502020-10-04NS091421CAREER IIS-1762268https://creativecommons.org/licenses/by-nc-nd/3.0/ie/