Re: hash as an search key and hash collision

2020-06-19 Thread Andy Fan
On Sat, Jun 20, 2020 at 12:34 AM Tomas Vondra wrote: > On Fri, Jun 19, 2020 at 04:24:01PM +0800, Andy Fan wrote: > >I want to maintain an internal table which the primary key is sql_text and > >planstmt::text, it is efficient since it both may be very long. So a > >general > >idea is to use sql_

Re: hash as an search key and hash collision

2020-06-19 Thread Tomas Vondra
On Fri, Jun 19, 2020 at 04:24:01PM +0800, Andy Fan wrote: I want to maintain an internal table which the primary key is sql_text and planstmt::text, it is efficient since it both may be very long. So a general idea is to use sql_hash_value and plan_hash_value. Then we have to handle the hash col

hash as an search key and hash collision

2020-06-19 Thread Andy Fan
I want to maintain an internal table which the primary key is sql_text and planstmt::text, it is efficient since it both may be very long. So a general idea is to use sql_hash_value and plan_hash_value. Then we have to handle the hash collision case. However I checked the codes both in sr_plans[1