Why the index is not used ?

2018-10-06 Thread ROS Didier
Hi I would like to submit the following problem to the PostgreSQL community. In my company, we have data encryption needs. So I decided to use the following procedure : (1)Creating a table with a bytea type column to store the encrypted data CREATE TABLE cartedecredit(card_id SERIAL PRIMARY

Re: Why the index is not used ?

2018-10-06 Thread Pavel Stehule
so 6. 10. 2018 v 11:57 odesílatel ROS Didier napsal: > Hi > > I would like to submit the following problem to the PostgreSQL community. > In my company, we have data encryption needs. > So I decided to use the following procedure : > > > > (1)Creating a table with a bytea type column to store

Re: Why the index is not used ?

2018-10-06 Thread Vladimir Ryabtsev
Hello Didier, (3), (5) to find the match, you decrypt the whole table, apparently this take quite a long time. Index cannot help here because indexes work on exact match of type and value, but you compare mapped value, not indexed. Functional index should help, but like it was said, it against the

Re: Why the index is not used ?

2018-10-06 Thread Paul McGarry
I haven’t looked up what pgp_sym_encrypt() does but assuming it does encryption the way you should be for credit card data then it will be using a random salt and the same input value won’t encrypt to the same output value so WHERE cc=pgp_sym_encrypt('test value 32', 'motdepasse'); woul