Use only parquet files for events
This commit is contained in:
@@ -256,8 +256,8 @@ class NetworkRangesController < ApplicationController
|
||||
|
||||
def calculate_traffic_stats(network_range)
|
||||
if network_range.persisted?
|
||||
# Real network - use cached events_count for total requests (much more performant)
|
||||
if network_range.events_count > 0
|
||||
# Real network - check if network has events using DuckDB for performance
|
||||
if network_range.has_events?
|
||||
# Use indexed network_range_id for much better performance instead of expensive CIDR operator
|
||||
# Include child network ranges to capture all traffic within this network block
|
||||
network_ids = [network_range.id] + network_range.child_ranges.pluck(:id)
|
||||
|
||||
Reference in New Issue
Block a user