Tagged articles
COUNT
52 articles · Page 1 of 1

ITPUBJul 15, 2026 · Databases
The article analyzes how MySQL executes different COUNT() forms—count(*), count(1), count(primary‑key), and count(column)—showing that count(*) and count(1) have identical performance, count(column) is the slowest, and offers indexing and approximation tips for large tables.
COUNTIndexInnoDB
0 likes · 10 min read

The article explains how MySQL implements COUNT(1), COUNT(*), COUNT(primary_key) and COUNT(column), showing that COUNT(*) and COUNT(1) have identical performance, COUNT(column) is the slowest, and provides indexing and approximation tips for large InnoDB tables.
COUNTIndexInnoDB
0 likes · 9 min read

This guide explains how to use PHP's built‑in functions like count(), array_count_values(), and array_filter()—along with loops—to determine the total number of elements, count distinct values, and find the frequency of a specific item in an array.
BackendCOUNTarray
0 likes · 4 min read

The article explains that count(1) and count(*) produce identical results and similar execution plans, while count(column) skips NULL values; it also compares their performance under various table schemas and provides a MySQL example demonstrating these differences.
COUNTMySQLSQL
0 likes · 4 min read

This article explains the semantic differences, performance characteristics, and optimal usage scenarios of COUNT(*), COUNT(1), and COUNT(column) in MySQL 8.0+, covering engine behavior, indexing effects, common misconceptions, and practical best‑practice recommendations for interview preparation and real‑world development.
COUNTInterviewMySQL
0 likes · 10 min read

This article explains that PHP’s count() and sizeof() are interchangeable aliases, demonstrates their identical behavior with examples, discusses when to prefer one over the other, and shares performance, recursion, and object‑handling tips for backend developers.
COUNTPHParray
0 likes · 4 min read

This article explains Terraform’s count meta‑argument, showing how it transforms a single resource into a list for bulk creation, enables conditional provisioning with ternary expressions, illustrates blue‑green deployment switches, warns about index‑based pitfalls, and compares it with the more stable for_each alternative.
COUNTCloud AutomationIaC
0 likes · 9 min read

This article explains the performance differences among MySQL's COUNT(*), COUNT(1), and COUNT(column) forms, showing that COUNT(*) and COUNT(1) are equivalent and generally faster than counting specific columns, and provides practical recommendations for accurate row counting.
COUNTMySQLSQL
0 likes · 8 min read

This article explains how Terraform's count creates indexed resource lists that are hard to delete individually, why for_each with named keys offers more flexible and safe lifecycle management, and provides step‑by‑step migration and deletion examples.
COUNTCloud OperationsIaC
0 likes · 9 min read

This article explains how MySQL's count() works across storage engines, why InnoDB scans rows and can time out on massive tables, and presents practical alternatives such as using EXPLAIN rows, a dedicated count table, batch processing, or binlog‑to‑Hive for efficient row‑count estimation.
COUNTInnoDBMyISAM
0 likes · 14 min read

The article explains why Elasticsearch's _count and _stats APIs can return vastly different document totals, especially when nested fields are involved, and provides step‑by‑step analysis, code examples, and practical solutions such as index refresh and data‑model adjustments.
COUNTElasticsearchLucene
0 likes · 7 min read

This article tackles a common Python question—how to count the number of 1s in a list—by presenting four concise solutions using filter with a lambda, list comprehensions, the Counter class, and the built‑in count method, each illustrated with clear code examples.
COUNTCounterPython
0 likes · 4 min read

This article experimentally compares the performance of various MySQL COUNT queries on an InnoDB table with one million rows, explains the underlying execution plans using EXPLAIN, analyzes primary‑key versus secondary‑index behavior, and contrasts InnoDB’s fast count implementation.
COUNTEXPLAINInnoDB
0 likes · 9 min read

This article explains why COUNT(*) on a large InnoDB table can take seconds while MyISAM returns instantly, explores the underlying storage‑engine differences, and presents six practical techniques—including Redis counters, counting tables with transactions or triggers, parallel read threads, secondary indexes, and SHOW TABLE STATUS—to dramatically speed up row counting in MySQL.
COUNTInnoDBMySQL
0 likes · 9 min read

COUNT(*), COUNT(1) and COUNT(column) may look similar, but they differ in how MySQL processes them, the rows they count, and performance implications, especially with NULL values and index usage; this article explains each form, cites official InnoDB behavior, and guides proper usage.
COUNTInnoDBMySQL
0 likes · 6 min read

This article explains PHP's count() function, its syntax and parameters, and provides step‑by‑step examples for counting simple and multidimensional arrays using both normal and recursive modes. It also shows how to output the results and highlights the differences between COUNT_NORMAL and COUNT_RECURSIVE.
BackendCOUNTFunction
0 likes · 4 min read

This article examines whether SELECT COUNT(*) causes full‑table scans, explains MySQL’s optimizer cost‑based index selection (including IO and CPU costs), demonstrates with a 100k‑row table how auxiliary indexes are chosen, and shows cases where the optimizer’s estimates mislead performance.
COUNTIndex CostMySQL
0 likes · 9 min read

The article explains why counting rows in large MySQL tables—especially with InnoDB—can become slow, compares COUNT() performance across storage engines and query forms, and offers optimization tactics such as using metadata counts, EXPLAIN estimates, a dedicated counting table, or periodic batch processing for accurate or approximate results.
COUNTInnoDBMySQL
0 likes · 12 min read

Using MySQL's EXISTS() function for existence checks is generally more efficient and readable than COUNT(), especially in large datasets, and Laravel provides convenient query builder methods to implement EXISTS() queries, offering performance gains over COUNT() in PHP applications.
COUNTLaravelMySQL
0 likes · 6 min read

This article explains the PHP substr_count() function, its syntax, parameters, and demonstrates how to count substring occurrences with optional offset, length, and case‑sensitivity options through clear code examples.
COUNTOFFSETString
0 likes · 4 min read

This article explains the PHP count() function, covering its syntax, required and optional parameters, return values, practical examples for arrays, objects, and multidimensional structures, as well as common pitfalls and best practices for accurate length calculations.
COUNTObjectarray
0 likes · 5 min read

This article explains how to determine the length of one‑dimensional and multi‑dimensional arrays in PHP using the count() and sizeof() functions, shows code examples, discusses the two optional parameters of count(), and provides guidance on handling empty or undefined arrays.
COUNTarraysizeof
0 likes · 4 min read

This article explains several PHP techniques—including the count function, array_keys, foreach loops, and end/key combination—to determine how many keys an array contains, providing code examples and explanations for each method.
COUNTarray
0 likes · 5 min read

This article explains why MySQL count(*) can become a performance bottleneck on InnoDB tables, compares different count() variants, and presents practical optimization techniques such as Redis caching, second‑level caches, parallel execution, reducing joins, and offloading analytics to ClickHouse.
COUNTClickHouseInnoDB
0 likes · 10 min read

This article analyses how MySQL 5.7 InnoDB processes COUNT(*) versus COUNT(1), COUNT(id) and COUNT on indexed or non‑indexed columns, showing execution‑plan differences across various index configurations, explaining why count(*) can be unexpectedly slower and offering practical guidance for query optimization.
COUNTIndexInnoDB
0 likes · 10 min read

This article explains why MySQL's count(*) can become a performance bottleneck, especially with InnoDB, and presents practical optimization techniques such as Redis caching, second‑level in‑memory caches, parallel execution, reducing unnecessary joins, and using column‑store databases like ClickHouse.
COUNTClickHouseMySQL
0 likes · 10 min read

This article explains why MySQL's count(*) can be slow on InnoDB, compares different count variations, and presents practical optimization techniques such as Redis caching, second‑level caches, multithreading, reducing joins, and using ClickHouse for massive datasets.
COUNTClickHouseInnoDB
0 likes · 12 min read

This article explains how MySQL's count() works across different storage engines, compares the performance of various count() forms, and offers practical strategies—such as using EXPLAIN rows, auxiliary count tables, and batch processing—to obtain accurate or approximate row counts efficiently even on massive tables.
COUNTInnoDBMyISAM
0 likes · 13 min read

This article explains how MySQL COUNT() works under different storage engines, why counting rows becomes slow on large InnoDB tables, and presents practical methods such as using EXPLAIN rows, auxiliary count tables, batch processing, and transaction‑based updates to obtain approximate or exact row counts efficiently.
COUNTInnoDBMySQL
0 likes · 12 min read

This tutorial demonstrates multiple pandas techniques—including list comprehensions, str.count, str.findall, and str.extractall—to count occurrences of one or more characters in a Series, handling case‑insensitivity and complex grouping with concise code examples.
COUNTPandasPython
0 likes · 5 min read

The article explains why using COUNT(*) to test for record existence is inefficient and demonstrates how replacing it with SELECT 1 … LIMIT 1 in SQL and a corresponding Java existence check can significantly improve database query performance.
COUNTLIMITSQL
0 likes · 3 min read

A practical MySQL InnoDB test shows that count(1) and count(*) have almost identical performance, explains the underlying index usage, and clarifies why MyISAM can count rows faster due to its storage design.
COUNTEXPLAINIndex
0 likes · 9 min read

This article compares MySQL's COUNT(*), COUNT(1) and COUNT(column) functions, explains how each handles NULL values, analyzes performance differences on MyISAM and InnoDB engines, and provides practical recommendations for writing efficient count queries and existence checks.
COUNTCOUNT(1)COUNT(column)
0 likes · 9 min read

The article explains the functional differences and performance characteristics of MySQL's count(1), count(*), and count(column) expressions, showing when each is appropriate and providing a concrete example with query results to illustrate their behavior.
COUNTMySQLSQL
0 likes · 4 min read

The article explains PHP's count() function (alias sizeof()), its syntax, parameters—including the optional COUNT_RECURSIVE mode—and demonstrates how to count array elements and object properties with practical code examples, highlighting return values and behavior with null or non‑countable inputs.
BackendCOUNTObject
0 likes · 3 min read

This article explains the functional and performance differences among SQL count(1), count(*), and count(column) expressions, including how they handle NULL values and when each method is most efficient, illustrated with a MySQL example.
COUNTSQLdatabase
0 likes · 5 min read

The PHP count() function returns the number of elements in an array or the number of properties in an object, with an optional recursive mode for multidimensional arrays, and includes details on its signature, parameters, return values, and practical code examples.
COUNTFunctionObject
0 likes · 3 min read

This article explains the functional and performance differences among MySQL's count(1), count(*), and count(column) functions, illustrates how NULL handling varies, and provides a concrete example demonstrating their results and execution efficiency under different table schemas.
COUNTMySQLSQL
0 likes · 5 min read

This article examines whether MySQL's count(1) is faster than count(*), explains how InnoDB processes both expressions identically, compares them with count(column), and offers practical advice on avoiding costly full‑table counts.
COUNTInnoDBMySQL
0 likes · 5 min read

The article explains that when checking for the existence of records, using SELECT count(*) is inefficient and proposes replacing it with SELECT 1 … LIMIT 1, showing Java code examples and highlighting performance gains and reduced index usage.
COUNTExistence CheckLIMIT
0 likes · 3 min read

This article explains why using SELECT 1 with LIMIT 1 is a more efficient alternative to COUNT(*) when checking for the existence of rows, shows the common and optimized SQL/Java code patterns, and discusses the performance benefits and impact on index usage.
COUNTExistence CheckLIMIT
0 likes · 3 min read

The article explains why using SELECT 1 with LIMIT 1 is a more efficient alternative to COUNT(*) for existence checks in SQL and shows how to simplify the corresponding Java code for better performance.
COUNTExistence CheckJava
0 likes · 3 min read

An in‑depth investigation shows that counting rows with COUNT(*) on a MySQL table using the PRIMARY key index can be slower than a full table scan, revealing differences in execution plans, optimizer behavior, logical reads, and profiling data that explain the 0.02‑second performance gap.
COUNTMySQLPrimary Key
0 likes · 15 min read

The article explains why a SELECT COUNT(*) on a 5‑million‑row InnoDB table was extremely slow, analyzes the execution plan, demonstrates that the query used the primary (clustered) index, and shows how creating a small secondary index reduces the runtime from dozens of seconds to under a second.
COUNTInnoDBMySQL
0 likes · 8 min read

This article explains the MySQL COUNT function, compares COUNT(*), COUNT(1) and COUNT(column) usages, discusses common interview questions, and details the specific optimizations MyISAM and InnoDB apply to COUNT(*) queries, concluding with best‑practice recommendations.
COUNTInnoDBMyISAM
0 likes · 10 min read

This article explains how MySQL executes COUNT(*) and COUNT(column) queries on InnoDB tables, showing example results, detailing each layer's processing steps, the handling of NULL values, and the subtle performance differences between the two forms.
COUNTDatabase PerformanceInnoDB
0 likes · 10 min read

The article explains that MySQL's count(1) and count(*) perform identical full‑table scans with negligible performance difference, while count(column) only counts non‑NULL values, and it discusses execution‑plan effects and optimal usage depending on primary keys and table size.
COUNTMySQLSQL
0 likes · 6 min read

This guide explores advanced MySQL techniques—including ON DUPLICATE KEY UPDATE for upserts, INSERT IGNORE to bypass errors, replacing subqueries with JOINs, handling LEFT JOIN pitfalls, efficient pagination strategies, multi‑table UPDATE/DELETE via JOIN, and the nuances of COUNT(*) versus COUNT(1).
COUNTMySQLPagination
0 likes · 12 min read

This article explains the functional and performance differences among MySQL's count(*), count(1), and count(column) expressions, illustrates how NULL values affect each, and provides a practical example with query results to guide optimal usage.
COUNTMySQLQuery Performance
0 likes · 5 min read

This article debunks the myth that COUNT(1) is faster than COUNT(*), explains how MySQL engines handle these functions, compares their performance with COUNT(column), and offers practical tips for avoiding costly full‑table counts.
COUNTInnoDBMySQL
0 likes · 5 min read

This article explains the mechanisms behind MySQL's SELECT COUNT(*) operation, comparing InnoDB's row‑by‑row scan with MyISAM's constant‑time meta count, and explores execution steps, visibility rules, data structures, and performance implications.
COUNTInnoDBMyISAM
0 likes · 16 min read


ITPUBAug 10, 2017 · Databases
This article shares five actionable SQL techniques—concatenating fields, removing duplicate rows, leveraging WHERE clauses, using COUNT flexibly, and selecting only necessary columns—to improve query readability and efficiency in relational databases.
COUNTSQLWHERE
0 likes · 9 min read
