June 19, 2013

Post: Understanding the maximum number of columns in a MySQL table

…_MANY_FIELDS), MYF(0)); DBUG_RETURN(1); } Which is, of course, obvious! Various parts of this limit are: info_length is roughly… limit probably should be REC_MAX_N_FIELDS – 3 = 1020, but we play safe here */ DBUG_RETURN(HA_ERR_TO_BIG_ROW); } Which…; $c= int $c/36; } $name.=’0′ foreach(length $name .. shift); return $name } my $sql= “CREATE TABLE `”.cname(16,63).”` (“; foreach(1…

Post: Missing Data - rows used to generate result set

… writes it is not the number of rows returned by the query but number of rows accessed by the query will most likely… course in the perfect world we would like to see rows returned = rows analyzed. though this is only possible to reach for small… basic “single level” queries keeping in account JOINs, GROUP BY, LIMIT would already be helpful for many cases.

Post: When EXPLAIN can be misleading

…: mysql> explain select * from rnd order by r desc limit 1 \G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: rnd type… badly. Too bad –min-examined-row-limit is not yet implemented :) EXPLAIN would also return misleading number of rows for queries of the type: SELECT … FROM TBL WHERE KEY_PART1=CONST ORDER BY KEY_PART2 LIMIT

Post: A case for MariaDB's Hash Joins

… test cases. Since in Test B we have a limited set of rows in the supplier table (left operand) to join to… rows) from one table with a large table The SQL used for this test together with its EXPLAIN output as returned by…items DESC LIMIT 10; +—-+————-+——-+——-+——————————————–+———+———+——————-+———+———-+———————————————-+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered…

Comment: Four ways to optimize paginated displays

… exhaust the query in order to determine how many rows it COULD have returned, had you asked for all of them. 2… from a selectivity standpoint, if your limit clause is small relative to the size of your return set, you’ll get out… limit. e.g. if a query returns 100,000 rows order by timestamp limit 99990, 10 is MUCH slower than order by timestamp desc limit

Post: InnoDB Full-text Search in MySQL 5.6: Part 2, The Queries!

…that the results returned by InnoDB FTS …_stopword\G *************************** 1. row *************************** Table: INNODB_…BY 3 DESC LIMIT 5; +——–+——————————+——————–+ | id | full_name | score | +——–+——————————+——————–+…

Post: Identifying the load with the help of pt-query-digest and Percona Server

…_time: 0.117904 Lock_time: 0.002886 Rows_sent: 1 Rows_examined: 655360 Rows_affected: 0 Rows_read: 655361 # Bytes_sent: 68 Tmp_tables…-query-digest Output Now let’s see what output it returns. The first part of the output is an overall summary… be that you end up limiting the number of results returned by the query, by using a LIMIT clause or by filtering based…

Post: When the subselect runs faster

… 2 indexes where one is usable to find rows, while other is usable to return them in the right order. MySQL can… lot faster to retrieve rows in order checking WHERE clause for them until required number of rows were returned. Especially in the cases… (col1=’A'||col1=’B') order by id desc limit 20 offset 0; … 20 rows in set (0.00 sec) This approach works…

Post: Database access Optimization in Web Applications.

… think query is simple if it returns few rows while what really matters is amount of rows are analyzed by the query. For… Queries – SELECT name,descr FROM titles ORDER BY rank DESC LIMIT 10 – If there is no proper index and query has… on rank column maxes this query to use 10 rows to return 10 rows – exactly what we’re looking for. However our COUNT…

Post: Sphinx search performance optimization: attribute-based filters

… | Value | +—————+———-+ | total | 1000 | | total_found | 10309972 | | time | 0.700 | +—————+———-+ 3 rows in set (0.00 sec) Note this is a real… returned 20 rows because unless you specify an explicit LIMIT, it defaults to 20. Total says 1000 because by default query is limited to… | | time | 0.155 | +—————+——-+ 3 rows in set (0.00 sec) Pretty bad, isn’t it? 287 records returned in 155ms. Doing the…