druid icon indicating copy to clipboard operation
druid copied to clipboard

Merge vs. Compact - What's the difference?

Open teeram opened this issue 8 years ago • 5 comments

Hello, I have a question pertaining to what the difference is between running a Merge Task and a Compact Task. Particularly, what is the difference between a Same Interval Merge Task and a Compact Task? It seems that a Compact Task starts a new indexing job under the hood that uses a Firehose to a) read all the existing segment data and b) create a brand new re-indexed segment(s) from the existing data. I'm a little blurry on how the Same Interval Merge Task differs, but it seems to focus on combining the data instead of a total re-index. Could someone help clarify the differences between these two tasks? Also it would be nice to know the general rule for when I should use a Same Interval Merge Task instead of a Compact Task and vice versa.

Thank you!

teeram avatar Jul 04 '18 19:07 teeram

The compact task is meant to be a nicer interface to the "index" task. It basically creates an index task with the proper config to repartition a chunk of segments (by reading them in and then re-writing them). It may repartition N input segments to M output segments.

The merge task makes one output segment and is coded specifically to read segments itself, rather than to generate an index task that does the same. I'm not sure if its performance is any different from the compact task. Its restriction that it must generate one single output segment means that it's somewhat less flexible.

Fwiw the compact task is part of us trying to achieve a vision of flexible, scalable automatic compaction in Druid. So hopefully that becomes the way of the future.

gianm avatar Jul 05 '18 07:07 gianm

Gotcha, thanks @gianm, very much appreciate the info.

teeram avatar Jul 06 '18 00:07 teeram

This issue has been marked as stale due to 280 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

stale[bot] avatar Jun 21 '19 00:06 stale[bot]

This issue has been marked as stale due to 280 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

stale[bot] avatar Apr 09 '20 21:04 stale[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

stale[bot] avatar May 07 '20 22:05 stale[bot]