Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-37723

In MDEV-36861, analyze Q4

    XMLWordPrintable

Details

    Description

      select o_orderpriority, count(*) as order_count
      from ORDERS
      where
        o_orderdate >= date '1993-06-01'
        and o_orderdate < date '1993-06-01' + interval '3' month
        and exists
        (
          select * from LINEITEM 
          where l_orderkey = o_orderkey and l_commitdate < l_receiptdate
        )
      group by o_orderpriority
      order by o_orderpriority;
      

      10.11 uses First Match:

      query_id	id	select_type	table	type	possible_keys	key	key_len	ref	rows	r_rows	filtered	r_filtered	Extra
      q4	1	PRIMARY	ORDERS	ALL	PRIMARY	NULL	NULL	NULL	1469276	1500000.00	100	3.82	Using where; Using temporary; Using filesort
      q4	1	PRIMARY	LINEITEM	ref	PRIMARY,IDX_LINEITEM_ORDERKEY_FKIDX	PRIMARY	8	tpch.ORDERS.O_ORDERKEY	1	1.45	100	63.43	Using where; FirstMatch(ORDERS)
      

      11.4 uses Materialization:

      query_id	id	select_type	table	type	possible_keys	key	key_len	ref	rows	r_rows	filtered	r_filtered	Extra
      q4	1	PRIMARY	ORDERS	ALL	PRIMARY	NULL	NULL	NULL	1465728	1500000.00	100	3.82	Using where; Using temporary; Using filesort
      q4	1	PRIMARY	<subquery2>	eq_ref	distinct_key	distinct_key	8	func	1	0.92	100	100	
      q4	2	MATERIALIZED	LINEITEM	ALL	PRIMARY,IDX_LINEITEM_ORDERKEY_FKIDX	NULL	NULL	NULL	5982557	5992551.00	100	63.22	Using where
      

      Attachments

        1. mdev-37723-and-counters.diff
          4 kB
          Sergei Petrunia
        2. temptable-costs.sh
          2 kB
          Sergei Petrunia

        Issue Links

          Activity

            People

              Johnston Rex Johnston
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.