Re: Replace IN VALUES with ANY in WHERE clauses during optimization
От | Ivan Kush |
---|---|
Тема | Re: Replace IN VALUES with ANY in WHERE clauses during optimization |
Дата | |
Msg-id | 715d78b4-37f8-4de5-b8ac-f179f812edf3@tantorlabs.com обсуждение исходный текст |
Ответ на | Re: Replace IN VALUES with ANY in WHERE clauses during optimization (Alena Rybakina <a.rybakina@postgrespro.ru>) |
Ответы |
Re: Replace IN VALUES with ANY in WHERE clauses during optimization
|
Список | pgsql-hackers |
Do you mean, that I should try to execute such command? In this patch it gives ANY postgres=# EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) select * from table1 where fld2 in (VALUES('\\230\\211\\030f\\332\\261R\\333\\021\\356\\337z5\\336\\032\\372'::bytea), ('\\235\\204 \\004\\017\\353\\301\\200\\021\\355a&d}\\245\\312'::byte a)); QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------- Bitmap Heap Scan on table1 (actual rows=0 loops=1) Recheck Cond: (fld2 = ANY ('{"\\x5c3233305c3231315c303330665c3333325c323631525c3333335c3032315c3335365c3333377a355c3333365c3033325c333732","\\x5c3233355c323034205c30303 45c3031375c3335335c3330315c3230305c3032315c3335356126647d5c3234355c333132"}'::bytea[])) -> Bitmap Index Scan on table1index (actual rows=0 loops=1) Index Cond: (fld2 = ANY ('{"\\x5c3233305c3231315c303330665c3333325c323631525c3333335c3032315c3335365c3333377a355c3333365c3033325c333732","\\x5c3233355c323034205c3 030345c3031375c3335335c3330315c3230305c3032315c3335356126647d5c3234355c333132"}'::bytea[])) (4 rows) Do you plan to send your implementation to the hackers? On 10/3/24 23:10, Alena Rybakina wrote: > I think you should think about putting these constants in ANY Array > > EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) > select * from t > where x in (VALUES(1200), (1)); > QUERY PLAN > --------------------------------------------------- > Seq Scan on t (actual rows=1 loops=1) > Filter: (x = ANY ('{1200,1}'::integer[])) > (3 rows) -- Best wishes, Ivan Kush Tantor Labs LLC
В списке pgsql-hackers по дате отправления: