Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this article, we will be using a custom query with JOIN statement (to get derived data set) to build the data set for the Datalist. The custom query will be placed in JDBC Datalist Database Binder.

The This article's discussion and result is produced using MySQL 5.6 but should also be applicable to all RDBMS attached to Joget Workflow.

...

  • There are 2 tables, order and order_item.
  • order table has 1 million rows.
  • order_item has 2 million rows with foreign key order_id to table order and the necessary index added.
  • Every order has 2 order item.
  • This is the select query that we will use in the datalist binder.

    Code Block
    languagesql
    titleQuery
    SELECT o.*, i.* FROM app_fd_order o JOIN app_fd_order_item i ON o.id = i.order_id

...

Code Block
languagesql
titleCount Query
SELECT COUNT(*) FROM (SELECT o.*, i.* FROM app_fd_order o JOIN app_fd_order_item i ON o.id = i.order_id) temp

...