lorae / household-size

Analyze the extent to which demographic changes can account for changes in American household sizes since 2000.
MIT License
0 stars 0 forks source link

refactor range_match_lookup() to remove cross join #3

Open lorae opened 1 month ago

lorae commented 1 month ago

Cross joins are computationally inefficient: refactoring to use a different type of database query would significantly improve performance. Because therange_match_lookup() function is used by append_bucket_column(), it's difficult to chain two or more append_bucket_column() operations and compute them without taking significant time, since the consecutive SQL queries for cross joins are combined, causing slow speeds.