It will also be helpful to have finished [Tutorial: Loading a file](../tutorials/tutorial-batch.html) and [Tutorial: Querying data](../tutorials/tutorial-query.html).
For this tutorial, we'll be using the Wikipedia edits sample data, with an ingestion task spec that will create a separate segment for each hour in the input data.
The ingestion spec can be found at `quickstart/tutorial/compaction-init-index.json`. Let's submit that spec, which will create a datasource called `compaction-tutorial`:
After the ingestion completes, go to http://localhost:8081/#/datasources/compaction-tutorial in a browser to view information about the new datasource in the Coordinator console.
There will be 24 segments for this datasource, one segment per hour in the input data:
After the task finishes, refresh the http://localhost:8081/#/datasources/compaction-tutorial page.
The original 24 segments will eventually be marked as "unused" by the Coordinator and removed, with the new compacted segment remaining.
By default, the Druid coordinator will not mark segments as unused until the coordinator process has been up for at least 15 minutes, so you may see the old segment set and the new compacted set at the same time in the coordinator, e.g.:
The new compacted segment has a more recent version than the original segments, so even when both sets of segments are shown by the coordinator, queries will only read from the new compacted segment.
Let's try running a COUNT(*) on `compaction-tutorial` again, where the row count should still be 39,244:
After the coordinator has been running for at least 15 minutes, the http://localhost:8081/#/datasources/compaction-tutorial page should show there is only 1 segment:
![Compacted segments final state](../tutorials/img/tutorial-compaction-02.png "Compacted segments final state")