그리고 캐러멜 토핑도 넣고, 아니, 그건 생각해보니 좀 달 것 같아서 캐러멜은 취소해주세요. 그리고 샷 추가는 괜찮아 보이지만 일단 그냥 원래대로 주문할게요. 그리고 뜨거운 우유 대신에 아이스 우유로 주문하고 싶 은데, 그건 가능한가요? 얼음은 넣으면 안 되는 거죠? 아, 그리고 초콜릿 모카 는 아이스로 할게요. 얼음을 좀 덜 넣어주세요. 크림은 처음에 많이 했던 거 그 대로 주시면 돼요. 휘핑은 그냥 생각 없이 두 번 추가해주세요. 아, 그리고 블 루베리 머핀 대신에 초콜릿 칩 쿠키로 바꿔주세요!" 어떤 고객이 될 것인가
ROW_NUMBER() OVER (ORDER BY price DESC) AS price_rank, RANK() OVER (PARTITION BY type ORDER BY price DESC) AS type_price_rank FROM test WHERE city = 'SACRAMENTO';
btree (column_name); • B-tree • Hash Index • GiST Index • GIN Index • BRIN Index Each index type uses a different algorithm that is best suited to different types of queries. By default, the CREATE INDEX command creates B-tree indexes, which fit the most common situations. The other index types are selected by writing the keyword USING followed by the index type name.
= 123; UNION ALL SELECT * FROM orders WHERE order_date > '2023-01-01'; SELECT * FROM orders WHERE customer_id = 123 OR order_date > '2023-01-01'; ++ Clustered Index는? CLUSTER orders USING order_date ;
Scan • Bitmap Index Scan • TID Scan • Custom Scan The method used to retrieve data from a table or index. The structure of a query plan is a tree of plan nodes. Nodes at the bottom level of the tree are scan nodes: they return raw rows from a table.
• Merge join Logical joins refer to the relational theory aspect of joining tables, defined by SQL JOIN operations like INNER JOIN, LEFT JOIN, etc., focusing on how tables are logically combined based on specified conditions. Physical joins, on the other hand, are about how a database system actually implements these logical join operations, involving methods like nested loops, hash joins, or merge joins, which are concerned with execution efficiency and optimization. • Inner join • Left join • Outer join