Skip to content

Enable simpler indexing on encrypted records with hmac_256 #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025

Conversation

tobyhede
Copy link
Contributor

@tobyhede tobyhede commented Jun 6, 2025

Usage

CREATE INDEX ON encrypted (e eql_v2.encrypted_hmac_256_operator);

EXPLAIN ANALYZE SELECT e::jsonb FROM encrypted WHERE e = '("{\"hm\": \"abc\"}")';

                                                      QUERY PLAN
------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on encrypted  (cost=4.20..16.65 rows=6 width=32) (actual time=0.010..0.011 rows=0 loops=1)
   Recheck Cond: (e = '("{""hm"": ""abc""}")'::eql_v2_encrypted)
   ->  Bitmap Index Scan on encrypted_e_idx  (cost=0.00..4.20 rows=6 width=0) (actual time=0.004..0.005 rows=0 loops=1)
         Index Cond: (e = '("{""hm"": ""abc""}")'::eql_v2_encrypted)
 Planning Time: 0.593 ms
 Execution Time: 0.043 ms

@tobyhede tobyhede force-pushed the enable-index-on-hmac_256 branch from 51ace5d to 7e691e4 Compare June 10, 2025 00:14
Comment on lines +38 to +41
-- PERFORM eql_v2.log('eql_v2.has_hmac_256(a)', eql_v2.has_hmac_256(a)::text);
-- PERFORM eql_v2.log('eql_v2.has_hmac_256(b)', eql_v2.has_hmac_256(b)::text);
-- PERFORM eql_v2.log('eql_v2.has_ore_block_u64_8_256(b)', eql_v2.has_ore_block_u64_8_256(b)::text);
-- PERFORM eql_v2.log('eql_v2.has_ore_block_u64_8_256(b)', eql_v2.has_ore_block_u64_8_256(b)::text);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to leave this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is still WIP, sorry

@tobyhede tobyhede merged commit 9164d73 into main Jun 23, 2025
4 checks passed
@tobyhede tobyhede deleted the enable-index-on-hmac_256 branch June 23, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants