Postgres DB performance for Split vs concatenate when matching

空扰寡人 提交于 2019-12-25 00:15:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!