Skip to content

Commit 89fbec2

Browse files
committed
DPL Analysis: avoid calculating indexing columns
All we need to know is that there is at least one for the constrain to apply.
1 parent 6e582ef commit 89fbec2

File tree

1 file changed

+13
-6
lines changed
  • Framework/Core/include/Framework

1 file changed

+13
-6
lines changed

Framework/Core/include/Framework/ASoA.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,31 +1024,38 @@ concept can_bind = requires(T&& t) {
10241024
{ t.B::mColumnIterator };
10251025
};
10261026

1027+
template <typename... C>
1028+
concept has_index = (is_indexing_column<C> || ...);
1029+
10271030
template <typename D, typename O, typename IP, typename... C>
10281031
struct TableIterator : IP, C... {
10291032
public:
10301033
using self_t = TableIterator<D, O, IP, C...>;
10311034
using policy_t = IP;
10321035
using all_columns = framework::pack<C...>;
10331036
using persistent_columns_t = framework::selected_pack<soa::is_persistent_column_t, C...>;
1034-
using indexing_columns_t = framework::selected_pack<is_indexing_t, C...>;
1035-
constexpr inline static bool has_index_v = framework::pack_size(indexing_columns_t{}) > 0;
10361037
using external_index_columns_t = framework::selected_pack<soa::is_external_index_t, C...>;
10371038
using internal_index_columns_t = framework::selected_pack<soa::is_self_index_t, C...>;
10381039
using bindings_pack_t = decltype([]<typename... Cs>(framework::pack<Cs...>) -> framework::pack<typename Cs::binding_t...> {}(external_index_columns_t{})); // decltype(extractBindings(external_index_columns_t{}));
10391040

10401041
TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy)
10411042
: IP{policy},
10421043
C(columnData[framework::has_type_at_v<C>(all_columns{})])...
1044+
{
1045+
bind();
1046+
}
1047+
1048+
TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy)
1049+
requires(has_index<C...>)
1050+
: IP{policy},
1051+
C(columnData[framework::has_type_at_v<C>(all_columns{})])...
10431052
{
10441053
bind();
10451054
// In case we have an index column might need to constrain the actual
10461055
// number of rows in the view to the range provided by the index.
10471056
// FIXME: we should really understand what happens to an index when we
10481057
// have a RowViewFiltered.
1049-
if constexpr (has_index_v) {
1050-
this->limitRange(this->rangeStart(), this->rangeEnd());
1051-
}
1058+
this->limitRange(this->rangeStart(), this->rangeEnd());
10521059
}
10531060

10541061
TableIterator() = default;
@@ -1192,7 +1199,7 @@ struct TableIterator : IP, C... {
11921199
[this]<typename T>(T*) -> void {},
11931200
};
11941201
(f(static_cast<C*>(nullptr)), ...);
1195-
if constexpr (has_index_v) {
1202+
if constexpr (has_index<C...>) {
11961203
this->setIndices(this->getIndices());
11971204
this->setOffsets(this->getOffsets());
11981205
}

0 commit comments

Comments
 (0)