Hi,
here's my problem:
# explain analyze select * from mxstrpartsbg where szam =
round(800000*random())::integer;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------
Seq Scan on mxstrpartsbg (cost=0.00..56875.04 rows=1 width=322) (actual
time=190.748..1271.664 rows=1 loops=1)
Filter: (szam = (round((800000::double precision * random())))::integer)
Total runtime: 1271.785 ms
(3 rows)
# explain analyze select * from mxstrpartsbg where szam = 671478;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------
Index Scan using mxstrpartsbg_pkey on mxstrpartsbg (cost=0.00..5.87
rows=1 width=322) (actual time=71.642..71.644 rows=1 loops=1)
Index Cond: (szam = 671478)
Total runtime: 71.706 ms
(3 rows)
Is there a way to have PostgreSQL to pre-compute all the constants in the
WHERE clause? It would be a huge performance gain. Thanks in advance.
Best regards,
Zoltán Böszörményi