diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2019-05-20 21:14:45 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-05-20 21:14:45 +0000 |
commit | 4a559250e9cf4c0a763c457603a889fb752210a6 (patch) | |
tree | 88b43c43d810ddbd49b3253ff70ea4bc315cabb3 | |
parent | 513ef55bd2588a21ecdbd0d743c5aede17d02a9b (diff) | |
parent | fc4353faa2d0a51f4518b5e3e301200c86a1956d (diff) | |
download | perfetto-4a559250e9cf4c0a763c457603a889fb752210a6.tar.gz |
Merge "Actually use primary key as index."
4 files changed, 8 insertions, 4 deletions
diff --git a/src/trace_processor/heap_profile_allocation_table.cc b/src/trace_processor/heap_profile_allocation_table.cc index bf2a1bff3..cadba7aa4 100644 --- a/src/trace_processor/heap_profile_allocation_table.cc +++ b/src/trace_processor/heap_profile_allocation_table.cc @@ -46,9 +46,10 @@ uint32_t HeapProfileAllocationTable::RowCount() { return storage_->heap_profile_allocations().size(); } -int HeapProfileAllocationTable::BestIndex(const QueryConstraints&, +int HeapProfileAllocationTable::BestIndex(const QueryConstraints& qc, BestIndexInfo* info) { info->order_by_consumed = true; + info->estimated_cost = HasEqConstraint(qc, "id") ? 1 : RowCount(); return SQLITE_OK; } diff --git a/src/trace_processor/heap_profile_callsite_table.cc b/src/trace_processor/heap_profile_callsite_table.cc index b76d4136f..38efe7209 100644 --- a/src/trace_processor/heap_profile_callsite_table.cc +++ b/src/trace_processor/heap_profile_callsite_table.cc @@ -43,9 +43,10 @@ uint32_t HeapProfileCallsiteTable::RowCount() { return storage_->heap_profile_callsites().size(); } -int HeapProfileCallsiteTable::BestIndex(const QueryConstraints&, +int HeapProfileCallsiteTable::BestIndex(const QueryConstraints& qc, BestIndexInfo* info) { info->order_by_consumed = true; + info->estimated_cost = HasEqConstraint(qc, "id") ? 1 : RowCount(); return SQLITE_OK; } diff --git a/src/trace_processor/heap_profile_frame_table.cc b/src/trace_processor/heap_profile_frame_table.cc index 06bda905b..2acf95730 100644 --- a/src/trace_processor/heap_profile_frame_table.cc +++ b/src/trace_processor/heap_profile_frame_table.cc @@ -42,9 +42,10 @@ uint32_t HeapProfileFrameTable::RowCount() { return storage_->heap_profile_frames().size(); } -int HeapProfileFrameTable::BestIndex(const QueryConstraints&, +int HeapProfileFrameTable::BestIndex(const QueryConstraints& qc, BestIndexInfo* info) { info->order_by_consumed = true; + info->estimated_cost = HasEqConstraint(qc, "id") ? 1 : RowCount(); return SQLITE_OK; } diff --git a/src/trace_processor/heap_profile_mapping_table.cc b/src/trace_processor/heap_profile_mapping_table.cc index 3cd86d318..e1a2b8e5e 100644 --- a/src/trace_processor/heap_profile_mapping_table.cc +++ b/src/trace_processor/heap_profile_mapping_table.cc @@ -46,9 +46,10 @@ uint32_t HeapProfileMappingTable::RowCount() { return storage_->heap_profile_mappings().size(); } -int HeapProfileMappingTable::BestIndex(const QueryConstraints&, +int HeapProfileMappingTable::BestIndex(const QueryConstraints& qc, BestIndexInfo* info) { info->order_by_consumed = true; + info->estimated_cost = HasEqConstraint(qc, "id") ? 1 : RowCount(); return SQLITE_OK; } |