pg-redis-fdw / redis_fdw

A PostgreSQL foreign data wrapper for Redis
494 stars 68 forks source link

Performance problem #20

Closed Serob closed 3 years ago

Serob commented 7 years ago

Is it normal that inserting a single two-column line in a redis_fdw scalar/hash table lasts much longer than in a regular Postgres table (in average 0.6 ms vs 0.06 ms) while ram is nearly free? Almost the same situation with reading. I thought that read/write actions in in-memory database should take less (or equal) time than in Postgres (which is true for direct access) . But benchmarks show opposite! What can cause such behavior?

My system is Ubuntu 14, Postgres 9.3, Redis 2.8.4 RAM 3GB, Processor 4 core 2.3 GHz HDD SATA2 with below average speed

adunstan commented 3 years ago

There is the redis connection overhead. Also, PostgreSQL also caches tables in memory (shared_buffers). So this is not necessarily surprising.