set pause on

delete from plan_table;

explain plan set statement_id = 'SELEKCJA_PO_KLUCZU' for 
  select * 
    from a 
    where a1 > 100;
@explain selekcja_po_kluczu

explain plan set statement_id = 'SELEKCJA_PO_KLUCZU_MALY_ZAKRES' for
  select *
    from a
    where a1 between 100 and 130;
@explain selekcja_po_kluczu_maly_zakres

explain plan set statement_id = 'SELEKCJA_TYLKO_INDEKS' for 
  select a1 
    from a 
    where a1 > 100;
@explain selekcja_tylko_indeks

explain plan set statement_id = 'SELEKCJA_TYLKO_INDEKS_0' for 
  select a1 
    from a 
    where a1 + 0 > 100;
@explain selekcja_tylko_indeks_0

explain plan set statement_id = 'SELEKCJA_PO_KLUCZU_0' for 
  select * 
    from a 
    where a1 + 0 > 100;
@explain selekcja_po_kluczu_0

explain plan set statement_id = 'SELEKCJA_NIE_PO_KLUCZU' for
  select * 
    from a 
    where a2 > 100;
@explain selekcja_nie_po_kluczu

explain plan set statement_id = 'PRODUKT' for
  select a1
    from a, b;
@explain produkt

explain plan set statement_id = 'PRODUKT_A_B' for
  select a1, b1
    from a, b;
@explain produkt_a_b

explain plan set statement_id = 'ZLACZENIE' for
  select a2
    from a, b
    where a1 = b2;
@explain zlaczenie

explain plan set statement_id = 'ZLACZENIE_BEZ_ODCZYTU_A' for
  select b1
    from a, b
    where a1 = b2;
@explain zlaczenie_BEZ_ODCZYTU_A

explain plan set statement_id = 'ZLACZENIE_TYLKO_INDEKS' for
  select b1
    from a, b
    where a1 = b1;
@explain zlaczenie_TYLKO_INDEKS

explain plan set statement_id = 'NIE_PO_KLUCZU' for
  select a1, b2
    from a, b
    where a2 = b2;
@explain nie_po_kluczu

explain plan set statement_id = 'POTROJNY_Z_KLUCZEM' for
  select a1, b2, c2
    from a, b, c
    where a2 = b1 and b1 = c1;
@explain potrojny_z_kluczem

explain plan set statement_id = 'POTROJNY' for
  select a1, b1, c2
    from a, b, c
    where a2 = b2 and b2 = c1;
@explain potrojny

explain plan set statement_id = 'POTROJNY_C' for
  select a2, b2, c1
    from a, b, c
    where a1 = c2 and b1 = c1;
@explain potrojny_c

explain plan set statement_id = 'POTROJNY_C_PRIM' for
  select a2, b2
    from a, b, c
    where a1 = c2 and b1 = c1;
@explain potrojny_c_prim

explain plan set statement_id = 'POTROJNY_C_TOT' for
  select a2, b2
    from a, b, c
    where a1 = c2 and b1 = c1 and a1 = b2;
@explain potrojny_c_tot

