From 8cbf7ae33ce8a3f89ca8a32dfb7e585d26dbc795 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 9 Jul 2024 12:21:44 +0200 Subject: [PATCH] Fix outdated sliceBy usage --- docs/tutorials/indexTables.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/indexTables.md b/docs/tutorials/indexTables.md index cd86e696..041385f6 100644 --- a/docs/tutorials/indexTables.md +++ b/docs/tutorials/indexTables.md @@ -65,10 +65,17 @@ struct ConsumeColExtra { ### PartitionColExtra -Index columns allow to easily select e.g. all tracks belonging to a given collision using the sliceBy() method (see also [DECLARE_SOA_TABLE](creatingTables.md#declareTables)). groupedTracks contains only tracks which belong to Collision col. - +Index columns allow to easily select e.g. all tracks belonging to a given collision using the `sliceBy()` method (see also [DECLARE_SOA_TABLE](creatingTables.md#declareTables)). groupedTracks contains only tracks which belong to Collision col. +The slicing needs to be pre-declared using `Preslice` (or `PresliceUnsorted` if the index is not sorted) so that the framework can prepare and add it to the internal cache. ```cpp -auto groupedTracks = tracks.sliceBy(aod::track::collisionId, col.globalIndex()); +struct Task { + Preslice perCol = aod::track::collisionId; + void proces(aod::Collisions const & cols, aod::Tracks const& tracks) { + for (auto& col : cols) { + auto groupedTracks = tracks.sliceBy(perCol, col.globalIndex()); + } + } +} ```