title: Will i get benefits of hyper table if I have a query in which I join a hyper table with a normal (non-hyper) table in timescaledb
body: <p>I have to fetch record from two tables, there is one table is hyper table another table is normal table.</p>
  
  <p>Hyper table primary key (a UUID, not a timestampz column) is used as foreign key in 2nd normal table.</p>
  
  <p>The hyper table has one to many relationship with the normal table.</p>
  
  <p>Will I get all benefits of hyper table here if I select record after joining this table?</p>
  
  <p>I am using postgresql database for timescale. </p>
  
  <p>Below are create table queries for same. The demography_person is the hypertable and the emotions_person is the normal table</p>
  
  <pre><code>CREATE TABLE public.demography_person
  (
    start_timestamp timestamp with time zone NOT NULL,
    end_timestamp timestamp with time zone,
    demography_person_id character varying NOT NULL,
    device_id bigint,
    age_actual numeric,
    age_band integer,
    gender integer,
    dwell_time_in_millis bigint,
    customer_id bigint NOT NULL
  );
  
  SELECT create_hypertable('demography_person', 'start_timestamp');
  
  CREATE TABLE public.emotions_person
  (
    emotion_start_timestamp timestamp with time zone NOT NULL,
    demography_person_id character varying NOT NULL,
    count integer,
    emotion integer,
    emotion_percentage numeric
  );
  </code></pre>
  
  <p>select  sql Query is like:- </p>
  
  <pre><code>SELECT * FROM crosstab
               (
                 $$
                     SELECT * FROM  ( select  to_char(dur,'HH24') as duration , dur as time_for_sorting from 
                  generate_series(
              timestamp '2019-04-01 00:00:00',
              timestamp '2020-03-09 23:59:59' ,
              interval  '1 hour'
                  ) as dur   ) d
                     LEFT JOIN (  
                     select to_char(
                                      start_timestamp ,
                                     'HH24'
                                     )
                     as duration,
                     emotion,count(*) as count from demography_person dp INNER JOIN (
              select  distinct ON (demography_person_id)  demography_person_id, emotion_start_timestamp,count,emotion,emotion_percentage,
              (CASE emotion when 4 THEN 1 when 6  THEN 2 when 1 THEN 3  WHEN 3 THEN 4 WHEN 2 THEN 5  when 7 THEN 6  when 5 THEN 7  ELSE 8 END )  
               as emotion_key_for_sorting from emotions_person  where    demography_person_id in (select demography_person_id from demography_person where start_timestamp &gt;= '2019-04-01 00:00:00'
              AND start_timestamp &lt;= '2020-03-09 23:59:59' AND device_id IN ( 2052,2692,1797,2695,1928,2697,2698,1931,2574,2575,2706,1942,1944,2713,1821,2719,2720,2721,2722,2723,2596,2725,2217,2603,1852,2750,1726,1727,2754,2757,1990,2759,2760,2376,2761,2762,2257,2777,2394,2651,2652,1761,2658,1762,2659,2788,2022,2791,2666,1770,2026,2028,2797,2675,1780,2549 ))   
                 order by demography_person_id asc,emotion_percentage desc, emotion_key_for_sorting asc 
                     ) ep ON
                     ep.demography_person_id = dp.demography_person_id
                     WHERE start_timestamp &gt;= '2019-04-01 00:00:00'
  AND start_timestamp &lt;= '2020-03-09 23:59:59' AND device_id IN ( 2052,2692,1797,2695,1928,2697,2698,1931,2574,2575,2706,1942,1944,2713,1821,2719,2720,2721,2722,2723,2596,2725,2217,2603,1852,2750,1726,1727,2754,2757,1990,2759,2760,2376,2761,2762,2257,2777,2394,2651,2652,1761,2658,1762,2659,2788,2022,2791,2666,1770,2026,2028,2797,2675,1780,2549 ) AND gender IN ( 1,2 )
                     group by 1,2 ORDER  BY 1,2 ASC
                     ) t USING (duration) GROUP  BY 1,2,3,4 ORDER  BY time_for_sorting;           
                 $$ ,
                 $$
                   select emotion from (
                                                            values ('1'), ('2'), ('3'),('4'), ('5'), ('6'),('7'), ('8')
                                                      ) t(emotion)
                $$ 
           ) AS ct 
                (
                     duration text,
                     time_for_sorting  timestamp,
                    ANGER bigInt,
                    DISGUSTING bigInt,
                    FEAR bigInt,
                    HAPPY bigInt,
                    NEUTRAL bigInt,
                    SAD bigInt,
                    SURPRISE bigInt,
                    NO_DETECTION bigInt
               ); 
  </code></pre>