首页 > 解决方案 > Difference between Apache Ignite SQL and Scan Query?

问题描述

I'm wondering what's the difference between Ignite SQL and Scan Query, including but not limited to:

  1. What are strengths and weaknesses of them?
  2. Does Scan Query support Index like SQL?
  3. Is there any query optimization for SQL/Scan Query specifically?
  4. Performance comparison between them?
  5. Ignite SQL make use of H2 database to query cache, does Scan Query do it this way too? What's the way of Scan Query if not?

Thanks

标签: ignite

解决方案


SqlQuery

  • (+) Can provide better performance with proper indexes
  • (+) Full power of SQL: Joins, aggregations, groupings
  • (-) Requires QueryEntity configuration
  • (-) Consumes more memory for indexes and internal data structures

ScanQuery

  • (+) In some cases, more flexible, since filter and transformer can contain arbitrary code
  • (-) Always performs full cache scan (does not use indexes in any way)
  • (-) Requires filter and transformer code (classes) to be deployed to the server nodes

I would say that SQL is the default choice for most use cases. ScanQuery is useful when filter/transformer logic can't be expressed in SQL and/or require custom method calls.


推荐阅读