mySQL, hands down. It’s optimized to do this, and can make use of indexes. This would be horrible to do in PHP (and you would reach the memory_limit
quickly).
More Related Contents:
- MyISAM versus InnoDB [closed]
- How can i optimize MySQL’s ORDER BY RAND() function?
- Why does MYSQL higher LIMIT offset slow the query down?
- Is there a REAL performance difference between INT and VARCHAR primary keys?
- How to find similar results and sort by similarity?
- Mysql: Select rows from a table that are not in another
- Sorting varchar field numerically in MySQL
- Mysql order by specific ID values
- MySQL: Fastest way to count number of rows
- MySQL vs MongoDB 1000 reads
- MySQL stored procedures use them or not to use them
- UUID performance in MySQL?
- MySQL “IN” operator performance on (large?) number of values
- How can I speed up a MySQL query with a large offset in the LIMIT clause?
- Optimal MySQL settings for queries that deliver large amounts of data?
- What is better in MYSQL count(*) or count(1)?
- DOs and DONTs for Indexes [closed]
- MySQL performance: multiple tables vs. index on single table and partitions
- MySQL view performance
- “SELECT COUNT(*)” is slow, even with where clause
- Higher cardinality column first in an index when involving a range?
- Does Order of Fields of Multi-Column Index in MySQL Matter
- sql group by versus distinct
- mysql custom sort
- How can “set timestamp” be a slow query?
- Would it help to add index to BIGINT column in MySQL?
- ALTER TABLE ADD COLUMN takes a long time
- ORDER BY alphabet first then follow by number
- Composite Primary Key performance drawback in MySQL
- Default sort-ordering in MySQL (ALTER TABLE … ORDER BY …;)