aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-05-20 21:14:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-05-20 21:14:45 +0000
commit4a559250e9cf4c0a763c457603a889fb752210a6 (patch)
tree88b43c43d810ddbd49b3253ff70ea4bc315cabb3
parent513ef55bd2588a21ecdbd0d743c5aede17d02a9b (diff)
parentfc4353faa2d0a51f4518b5e3e301200c86a1956d (diff)
downloadperfetto-4a559250e9cf4c0a763c457603a889fb752210a6.tar.gz
Merge "Actually use primary key as index."
-rw-r--r--src/trace_processor/heap_profile_allocation_table.cc3
-rw-r--r--src/trace_processor/heap_profile_callsite_table.cc3
-rw-r--r--src/trace_processor/heap_profile_frame_table.cc3
-rw-r--r--src/trace_processor/heap_profile_mapping_table.cc3
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;
}