Polypheny-DB icon indicating copy to clipboard operation
Polypheny-DB copied to clipboard

Add a way to specify a preferred store which should be used for queries

Open gartens opened this issue 1 year ago • 0 comments

Summary

This is a prototype on how users can influence the data store chosen by Polypheny. At the moment it is only implemented for SQL queries and it operates on a table as a whole, this might very well be expanded to column level (hence why it is parsed as part of a compound identifier). The handling of the preference inside the router is still not optimal.

How to use

Let's assume we have a table orders that is placed on two stores with the unique names p and q. The store p is very fast and q is slow. For an interactive request the programmer can have Polypheny use the fast store with query like this:

    SELECT order_id, order_date, ... FROM orders @ p WHERE ...

But when running large scale analysis, where slower load times are acceptable, the query is routed to the slow store:

    SELECT order_id, order_date, ... FROM orders @ q WHERE ...

Testing

Place a table on two stores. Then query the table with the syntax above in the UI. In the routing tab on the left, it should show that the selected placement was used (or at least preferred when not all columns were present on the selected store).

Bugs

  • Any identifier can be annotated. No warnings or errors are given when this annotation has no effect.

  • No special error handling or warning when the placement does not exist.

  • Only implemented for the SimpleRouter so far. Should be fairly easy to extend to the other routers as well.

  • Other placements are used if the preferred one does not have all the columns. (this might be a feature)

gartens avatar Apr 06 '23 19:04 gartens