Bug 3006

Summary: Keep result of UNION sorted when inputs are sorted
Product: SQL Reporter: Roberto Cornacchia <roberto.cornacchia>
Component: allAssignee: SQL devs <bugs-sql>
Status: NEW ---    
Severity: enhancement CC: y.zhang
Priority: Normal Keywords: NONEEDTOTEST
Version: -- development   
Hardware: All   
OS: All   

Description Roberto Cornacchia 2012-02-14 17:20:14 CET
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
Build Identifier: 

Currently, the MAL plan of a sql UNION clause is translated using appends.
When the input tables are sorted on the same attribute it makes sense to use a merge-union approach, to maintain sortedness in the result.

The expected impact is large for certain applications. For example, this would make it viable to build sorted dictionaries incrementally: appending deltas and then sorting explicitly is no option with large data. This is one of the few show-stoppers I still see to use MonetDB (more) efficiently for IR.
(hint: I know the same core functionality was used within MonetDB/XQuery)

Reproducible: Always
Comment 1 Sjoerd Mullender cwiconfidential 2012-08-24 14:56:05 CEST
Jul2012-SP1 has been released.
Comment 2 Ying Zhang cwiconfidential 2012-11-27 15:46:05 CET
No test needed for feature request