3 ms·
> maybe paying customers could be segregated into their own separate table from non-paying users. If you know that, for example, you just need the customer ID
by jhugo 5y ago
> maybe paying customers could be segregated into their own separate table from non-paying users.
If you know that, for example, you just need the customer ID and name of paying customers, you can also make an index on (is_paying, customer_id, customer_name).
Any database engine worth its salt will then be able to satisfy such a query entirely from the index without reading any pages from the actual table, making this basically equivalent to the "separate table" approach but without the "administrative" overhead.