Paw Index Advisor
  • What is Paw Index Advisor?
  • Guides
    • User Guide - IDE Plugins
    • User Guide - Command Line
    • SQL Syntax
    • Comparison
    • Usercase-TPCH
      • TPCH Schema
      • TPCH Queries
        • Query 1
        • Query 2
        • Query 3
      • Indice recomended
  • Contact us
  • EULA
  • pawsqladvisor
Powered by GitBook
On this page

Was this helpful?

  1. Guides
  2. Usercase-TPCH
  3. TPCH Queries

Query 2

select
	s_acctbal,
	s_name,
	n_name,
	p_partkey,
	p_mfgr,
	s_address,
	s_phone,
	s_comment
from
	part,
	supplier,
	partsupp,
	nation,
	region
where
	p_partkey = ps_partkey
	and s_suppkey = ps_suppkey
	and p_size = 30
	and p_type like '%STEEL'
	and s_nationkey = n_nationkey
	and n_regionkey = r_regionkey
	and r_name = 'ASIA'
	and ps_supplycost = (
		select
			min(ps_supplycost)
		from
			partsupp,
			supplier,
			nation,
			region
		where
			p_partkey = ps_partkey
			and s_suppkey = ps_suppkey
			and s_nationkey = n_nationkey
			and n_regionkey = r_regionkey
			and r_name = 'ASIA'
	)
order by
	s_acctbal desc,
	n_name,
	s_name,
	p_partkey
limit 100;
PreviousQuery 1NextQuery 3

Last updated 3 years ago

Was this helpful?