Tagged articles
48 articles
Page 1 of 1
php Courses
php Courses
Jan 26, 2026 · Backend Development

How to Count Array Elements, Unique Values, and Occurrences in PHP

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.

ArrayBackend_count
0 likes · 4 min read
How to Count Array Elements, Unique Values, and Occurrences in PHP
Java Architect Handbook
Java Architect Handbook
Jan 1, 2026 · Databases

COUNT(*), COUNT(1) or COUNT(column) in MySQL? Deep Interview Guide

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.

_countdatabase indexinginterview
0 likes · 10 min read
COUNT(*), COUNT(1) or COUNT(column) in MySQL? Deep Interview Guide
php Courses
php Courses
Nov 4, 2025 · Backend Development

count() vs sizeof(): Which PHP Function Should You Use?

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.

ArrayPHPRecursion
0 likes · 4 min read
count() vs sizeof(): Which PHP Function Should You Use?
Ops Development & AI Practice
Ops Development & AI Practice
Aug 28, 2025 · Cloud Computing

Master Terraform’s count Meta‑Argument: Bulk, Conditional, and Blue‑Green Deployments

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.

Terraform_countcloud automation
0 likes · 9 min read
Master Terraform’s count Meta‑Argument: Bulk, Conditional, and Blue‑Green Deployments
macrozheng
macrozheng
Apr 11, 2025 · Databases

Why MySQL count() Slows Down on Large Tables and How to Speed It Up

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.

InnoDBMyISAM_count
0 likes · 14 min read
Why MySQL count() Slows Down on Large Tables and How to Speed It Up
IT Services Circle
IT Services Circle
Feb 2, 2025 · Databases

Performance Comparison of MySQL COUNT Queries on InnoDB and MyISAM

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.

InnoDB_countdatabase
0 likes · 9 min read
Performance Comparison of MySQL COUNT Queries on InnoDB and MyISAM
Senior Tony
Senior Tony
Dec 6, 2024 · Databases

Why MySQL COUNT(*) Can Be Milliseconds Fast: Engine Tricks & Optimization Strategies

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.

InnoDBParallel Read_count
0 likes · 9 min read
Why MySQL COUNT(*) Can Be Milliseconds Fast: Engine Tricks & Optimization Strategies
php Courses
php Courses
Aug 26, 2024 · Backend Development

Using PHP count() Function to Determine Array and Object Lengths

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.

ArrayBackendTutorial
0 likes · 4 min read
Using PHP count() Function to Determine Array and Object Lengths
dbaplus Community
dbaplus Community
Apr 10, 2024 · Databases

How MySQL Chooses the Cheapest Index for COUNT(*) and When It Gets It Wrong

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.

Index CostOptimizer_trace_count
0 likes · 9 min read
How MySQL Chooses the Cheapest Index for COUNT(*) and When It Gets It Wrong
Java Tech Enthusiast
Java Tech Enthusiast
Jan 13, 2024 · Databases

Understanding MySQL COUNT() Performance and Optimization Strategies

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.

InnoDB_countdatabase
0 likes · 12 min read
Understanding MySQL COUNT() Performance and Optimization Strategies
php Courses
php Courses
Dec 16, 2023 · Databases

Why EXISTS() Is More Efficient Than COUNT() in MySQL and Laravel

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.

Database OptimizationEXISTSLaravel
0 likes · 6 min read
Why EXISTS() Is More Efficient Than COUNT() in MySQL and Laravel
php Courses
php Courses
Aug 23, 2023 · Backend Development

Using PHP substr_count() to Count Substring Occurrences

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.

OFFSETString_count
0 likes · 4 min read
Using PHP substr_count() to Count Substring Occurrences
php Courses
php Courses
Jul 11, 2023 · Backend Development

How to Get Array Length in PHP Using count() and sizeof()

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.

Array_countsizeof
0 likes · 4 min read
How to Get Array Length in PHP Using count() and sizeof()
php Courses
php Courses
Jul 11, 2023 · Backend Development

How to Count the Number of Keys in a PHP Array

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.

Array_count
0 likes · 5 min read
How to Count the Number of Keys in a PHP Array
Java Backend Technology
Java Backend Technology
May 30, 2023 · Databases

Why count(*) Slows Down MySQL and How to Optimize It

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.

InnoDBRedis Cache_count
0 likes · 10 min read
Why count(*) Slows Down MySQL and How to Optimize It
Laravel Tech Community
Laravel Tech Community
Mar 12, 2023 · Databases

Why COUNT(*) May Be Slower Than COUNT(1) in MySQL InnoDB

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.

InnoDB_countindex
0 likes · 10 min read
Why COUNT(*) May Be Slower Than COUNT(1) in MySQL InnoDB
Su San Talks Tech
Su San Talks Tech
Nov 16, 2022 · Databases

Why count(*) Slows Down MySQL and How to Optimize It

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
Why count(*) Slows Down MySQL and How to Optimize It
Su San Talks Tech
Su San Talks Tech
Nov 16, 2022 · Databases

Why count(*) Is Slow in MySQL InnoDB and How to Speed It Up

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.

InnoDB_countclickhouse
0 likes · 12 min read
Why count(*) Is Slow in MySQL InnoDB and How to Speed It Up
macrozheng
macrozheng
Sep 30, 2022 · Databases

Why MySQL count(*) Slows Down on Large Tables and How to Optimize It

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.

InnoDBMyISAMSQL Optimization
0 likes · 13 min read
Why MySQL count(*) Slows Down on Large Tables and How to Optimize It
IT Services Circle
IT Services Circle
Jul 6, 2022 · Databases

Understanding MySQL COUNT() Performance and Strategies for Large Tables

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.

InnoDB_countdatabase
0 likes · 12 min read
Understanding MySQL COUNT() Performance and Strategies for Large Tables
Programmer DD
Programmer DD
Sep 13, 2021 · Databases

COUNT(*), COUNT(1) or COUNT(column) in MySQL? Which Is Faster?

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.

COUNT(1)COUNT(column)InnoDB
0 likes · 9 min read
COUNT(*), COUNT(1) or COUNT(column) in MySQL? Which Is Faster?
Architect
Architect
Nov 5, 2020 · Databases

Differences Between count(1), count(*), and count(column) in MySQL

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.

_countdatabasemysql
0 likes · 5 min read
Differences Between count(1), count(*), and count(column) in MySQL
Tech Musings
Tech Musings
Oct 31, 2019 · Databases

Master MySQL Tricks: Upserts, Ignoring Errors, Joins, Pagination & More

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).

Database OptimizationJOINUpsert
0 likes · 12 min read
Master MySQL Tricks: Upserts, Ignoring Errors, Joins, Pagination & More
ITPUB
ITPUB
Aug 10, 2017 · Databases

5 Practical SQL Query Tricks to Boost Database Readability and Performance

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.

WHERE_countselect
0 likes · 9 min read
5 Practical SQL Query Tricks to Boost Database Readability and Performance