3 ms·
You say you need indexes because “users want to slice and dice by various axes”, but have you checked that the query planner actually uses these indices? When a
by georgewfraser 8y ago
You say you need indexes because “users want to slice and dice by various axes”, but have you checked that the query planner actually uses these indices? When an aggregation includes a meaningful percentage of the table, a sequential scan will be faster than a series of indexed lookups. This is part of the reason why column stores don’t use indexes—they just aren’t that useful for analytical queries.
- stickfigure 8y agoYMMV but yes, for our application they were very significant. In a marketplace app with a significant number of sellers, most queries will be highly selective if only because they'll usually be filtered by seller. One of the top queries will be "show me my all-time sales". If your only index is time, you will touch your whole database every single time a customer asks for it...