问题
I have two tables t1 (15.6m rows) t2 (22m rows) both contain a property address which i want to use in a SELECT. However the two tables use different column format to store the address;
t1 has c1 with string 'apartment 1 building name' then c2 'street'
and c3 as 'apartment 1 building name street'
t2 has c1 with string 'building name' c2 as 'apartment 1' c3 as 'street'
To join the two datasets i understand my options to be add new column c4 in t2 which uses CONCAT
on c2 c1 c3 to match format of c4 in t1. Or use REGEX SPLIT
on t1 c1 so they follow the format of t2.
Which is the better approach. The final output will be a materialized view with both tables where the addresses match
来源:https://stackoverflow.com/questions/44587680/postgres-db-performance-for-split-vs-concatenate-when-matching