Efficiency worse than postgresql. Why ?

classic Classic list List threaded Threaded
7 messages Options
tomk tomk
Reply | Threaded
Open this post in threaded view
|

Efficiency worse than postgresql. Why ?

Hello,  
I measure time of time: number of rows is 15 000, using JDBC in both cases. My case is such that ignite is cache of postgresql. Entire database is loaded to cache (ignitevisorcmd shown 15 000 rows in cache scan).  
Ignite
SELECT COUNT(*): 53ms.
SELECT *:290 ms

Postgresql
SELECT COUNT(*): 3ms
SELECT *:89 ms.

Why ? I have no indexes in apache ignite.
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Efficiency worse than postgresql. Why ?

Hi,

I think your test makes much sense.

First of all, with Ignite you should make sure that all participating JVMs are warmed up and don't spent time on runtime byte code optimizations. Simply run the test case in a loop for some period of time (e.g., a minute) and only then start to take measurements. You will get much better results.

Second of all, I would recommend to test queries that are closer to what you're going to use in your application. With 'select *' and 'select count(*)' you will never get a clear picture which technology better fits your use case.

And finally, 15000 rows is a very little number and I doubt that you will get a visible improvement with Ignite. Ignite is a distributed system and allows you to scale large datasets across several nodes - this is the scenario when Ignite is much more powerful. On the other hand, Postgres already has its own in-memory caches and with such a small database there is a big chance that you never access disc at all.

-Val
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Efficiency worse than postgresql. Why ?

I meant "I don't think your test makes much sense." :)

-Val
tomk tomk
Reply | Threaded
Open this post in threaded view
|

Re: Efficiency worse than postgresql. Why ?

Thanks for your answer. What about 1000 000 rows ? 
Before, I didnt have set any index.

Should I use cache queries? How to switch on it using XML files ?

2016-05-20 14:44 GMT+02:00 vkulichenko <[hidden email]>:
I meant "I *don't* think your test makes much sense." :)

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Efficiency-worse-than-postgresql-Why-tp5040p5062.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Efficiency worse than postgresql. Why ?

With 1000000 rows there is a bigger chance to get improvement, but I would still recommend to test with real queries and get some relevant numbers.

Note that you should use queries unless simple get() operation is not enough. The latter will always perform better.

-Val
tomk tomk
Reply | Threaded
Open this post in threaded view
|

Re: Efficiency worse than postgresql. Why ?

I must use sql queries due to jdbc client.  I am not sure if I correctly undersand you - in jdbc client should I implement using get  ?
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Efficiency worse than postgresql. Why ?

If you're using JDBC driver to read Ignite data, then yes, the only way is using SQL queries.

-Val