Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1177 Cost-based query optimization
  3. PHOENIX-180

Use stats to guide query parallelization

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Resolution: Fixed
    • None
    • 4.2.0, 3.2.0
    • None
    • 49

    Description

      We're currently not using stats, beyond a table-wide min key/max key cached per client connection, to guide parallelization. If a query targets just a few regions, we don't know how to evenly divide the work among threads, because we don't know the data distribution. This other [issue] (https://github.com/forcedotcom/phoenix/issues/64) is targeting gather and maintaining the stats, while this issue is focused on using the stats.

      The main changes are:

      1. Create a PTableStats interface that encapsulates the stats information (and implements the Writable interface so that it can be serialized back from the server).
      2. Add a stats member variable off of PTable to hold this.
      3. From MetaDataEndPointImpl, lookup the stats row for the table in the stats table. If the stats have changed, return a new PTable with the updated stats information. We may want to cache the stats row and have the stats gatherer invalidate the cache row when updated so we don't have to always do a scan for it. Additionally, it would be idea if we could use the same split policy on the stats table that we use on the system table to guarantee co-location of data (for the sake of caching).

      • modify the client-side parallelization (ParallelIterators.getSplits()) to use this information to guide how to chunk up the scans at query time.

      This should help boost query performance, especially in cases where the data is highly skewed. It's likely the cause for the slowness reported in this issue: https://github.com/forcedotcom/phoenix/issues/47.

      Attachments

        1. Phoenix-180_WIP.patch
          229 kB
          ramkrishna.s.vasudevan
        2. Phoenix-180_v5.patch
          344 kB
          ramkrishna.s.vasudevan
        3. Phoenix-180_v3.patch
          342 kB
          ramkrishna.s.vasudevan
        4. Phoenix-180_V2.patch
          330 kB
          ramkrishna.s.vasudevan
        5. Phoenix-180_V1.patch
          331 kB
          ramkrishna.s.vasudevan
        6. Phoenix-180_3.0.patch
          225 kB
          ramkrishna.s.vasudevan

        Activity

          People

            ram_krish ramkrishna.s.vasudevan
            jamestaylor James R. Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: