Tagged articles
UNION
22 articles · Page 1 of 1
This article provides a comprehensive guide to MySQL's EXPLAIN command, detailing each column in the execution plan output with practical examples to help developers analyze and optimize SQL query performance.
EXPLAINMySQLSQL Performance
0 likes · 8 min read

This article explains MySQL join types, demonstrates inner, left, right, and self joins with sample tables, shows how to write subqueries (correlated and non‑correlated) and UNION/UNION ALL, compares their performance, and provides practical indexing and query‑writing tips.
MySQLSQLUNION
0 likes · 11 min read

This article explains how to reconstruct a 32‑bit floating‑point value from four serial bytes in embedded C by using a union or struct overlay, demonstrates the code, shows the resulting little‑endian byte order, and provides a simple function to detect system endianness.
C++Serial CommunicationUNION
0 likes · 5 min read

This article explains how MySQL OR conditions can cause index loss, demonstrates typical scenarios with multi‑field, range, and dynamic filters, and provides practical solutions such as using UNION/UNION ALL or adding appropriate indexes to restore efficient query performance.
Index OptimizationMySQLOR query
0 likes · 7 min read

This article explains how MySQL's OR conditions can cause index loss, provides concrete query examples, analyzes why the optimizer falls back to full table scans, and offers practical solutions such as rewriting with UNION or adding missing indexes to restore efficient index usage.
Index OptimizationMySQLOR query
0 likes · 7 min read

This article explains how to apply Python type hints—including basic types, the modern pipe syntax for optional values, collection generics, union types, and the flexible Any type—through clear examples and best‑practice guidance to make code more readable and safer.
OptionalPythonUNION
0 likes · 6 min read

This article walks through three real‑world MaxCompute optimization cases—tuning UNION handling, enabling JSON‑object batch extraction, and removing unnecessary GROUP BY—to dramatically reduce CPU, memory, and storage usage while improving job stability.
DistMapJoinJSONUDFMaxCompute
0 likes · 6 min read

This article explains the circumstances under which MySQL creates internal temporary tables, illustrating the behavior with UNION, UNION ALL, GROUP BY, various hints, and additional query patterns, and provides practical examples and execution plans to help developers understand and optimise their queries.
MySQLSQL HintUNION
0 likes · 13 min read


ITPUBAug 27, 2023 · Databases
This article explains how to leverage Redis Set, Sorted Set, Bitmap, and HyperLogLog data structures for various statistical scenarios such as user sign‑in tracking, friend recommendations, comment ranking, and UV counting, while addressing performance and memory considerations.
BitmapDifferenceHyperLogLog
0 likes · 11 min read

This article explores five obscure yet useful C language features—enum bit‑fields, label‑and‑goto error handling, varargs functions, unconventional union usage, and conditional compilation—providing clear explanations and code examples to help programmers write more flexible and efficient code.
Advanced TechniquesC++Conditional Compilation
0 likes · 5 min read

This article analyzes a sluggish MySQL query, explains why the original plan performs a full table scan, and demonstrates how rewriting the EXISTS clause as an INNER JOIN and substituting the OR condition with a UNION dramatically reduces execution time from 42 seconds to 18 milliseconds.
INNER JOINMySQLPerformance Tuning
0 likes · 6 min read

This article walks through common ODPS SQL scenarios—union, count distinct, large‑table joins, mapjoin, and predicate placement—explains why naïve implementations can be inefficient, shows how to read and interpret execution plans, and provides concrete rewritten queries that dramatically improve performance and resource usage.
COUNT DISTINCTMapJoinODPS
0 likes · 17 min read


ITPUBMar 25, 2023 · Big Data
This article walks through common SQL development scenarios on ODPS, examining why naïve UNION and COUNT DISTINCT can be slow, how to rewrite queries with GROUP BY, UNION ALL, JSON aggregation, and map‑join techniques, and shows the resulting execution‑plan improvements with concrete code and performance numbers.
CountDistinctMapJoinODPS
0 likes · 17 min read

This article explains C enumeration and union types, covering their definitions, common use cases, declaration syntax, variable creation, usage in switch statements and loops, and demonstrates how to access and correctly use union members with clear code examples.
C++EnumTutorial
0 likes · 8 min read

This article explains how to use Flink's DataStream.union() to combine multiple streams of the same type, demonstrates Maven project setup and code examples for simple unions and for unions with custom event-time sorting, and shows the resulting ordered output.
DataStreamEventTimeFlink
0 likes · 15 min read

This article explains multi‑table SQL queries, detailing Cartesian products, various join types (inner, left/right/full outer, self‑join, natural join, USING), UNION operations, and provides practical examples and exercises to illustrate correct join syntax and performance considerations.
Cross JoinJoinsSQL
0 likes · 18 min read

This article explains the standard SQL CORRESPONDING keyword, shows how HSQLDB implements it with UNION, INTERSECT and EXCEPT, demonstrates the optional BY clause for column selection, and discusses its limited support in other dialects such as PostgreSQL.
CORRESPONDINGEXCEPTHSQLDB
0 likes · 5 min read

When executing a Spark SQL query with dozens of UNION subqueries that each contain JOIN operations on Spark 3.1.2, the job fails because the total serialized result size of the tasks exceeds the driver’s maxResultSize limit, and the issue can be resolved by reducing the initial partition number used by Adaptive Query Execution.
DriverMaxResultSizePerformanceTuningSQL
0 likes · 10 min read

This article explains the purpose, syntax rules, and practical examples of the UNION operator in MySQL, covering distinct and ALL modes, ORDER BY restrictions, new TABLE and VALUES usages introduced in MySQL 8.0.19, and differences from MySQL 5.7.
CodeExamplesMySQLMySQL8
0 likes · 8 min read


ITPUBNov 27, 2018 · Databases
This guide presents four practical MySQL performance‑boosting techniques—selecting optimal column types, replacing sub‑queries with JOINs, using UNION instead of temporary tables, and employing transactions with BEGIN/COMMIT/ROLLBACK—to make queries faster and ensure data integrity.
MySQLSQLTransactions
0 likes · 6 min read


ITPUBFeb 6, 2017 · Information Security
This article provides a practical introduction to SQL injection, covering its fundamentals, common attack vectors such as Boolean‑based, error‑based, and UNION‑based injections, step‑by‑step exploitation examples with PHP code, and tips for constructing payloads and understanding their impact on vulnerable web applications.
Boolean-basedDatabase ExploitationError-based
0 likes · 13 min read

This article explains why replacing OR conditions with UNION queries in MySQL often yields faster execution, using a concrete users table example, EXPLAIN analysis, and a comparison of type and ref values to illustrate the performance advantage of UNION over OR.
MySQLSQLUNION
0 likes · 3 min read
