1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Increase max package length to 512M for mysql and mysqldump.

Faster 'read_first_row' (Fixes slow 'preparing' state)
Read constant tables earlier, which provides better optimzations when using tables with <=1 row.
This also fixes a complicated bug involving const tables.
This commit is contained in:
monty@hundin.mysql.fi
2002-01-23 02:52:26 +02:00
parent c7384b75fc
commit 4609e627a5
10 changed files with 425 additions and 270 deletions

View File

@ -472,17 +472,36 @@ int handler::analyze(THD* thd, HA_CHECK_OPT* check_opt)
return HA_ADMIN_NOT_IMPLEMENTED;
}
/* Read first row from a table */
/*
Read first row (only) from a table
This is never called for InnoDB or BDB tables, as these table types
has the HA_NOT_EXACT_COUNT set.
*/
int handler::rnd_first(byte * buf)
int handler::read_first_row(byte * buf, uint primary_key)
{
register int error;
DBUG_ENTER("handler::rnd_first");
DBUG_ENTER("handler::read_first_row");
statistic_increment(ha_read_first_count,&LOCK_status);
(void) rnd_init();
while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ;
(void) rnd_end();
/*
If there is very few deleted rows in the table, find the first row by
scanning the table.
*/
if (deleted < 10 || primary_key >= MAX_KEY)
{
(void) rnd_init();
while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ;
(void) rnd_end();
}
else
{
/* Find the first row through the primary key */
(void) index_init(primary_key);
error=index_first(buf);
(void) index_end();
}
DBUG_RETURN(error);
}
@ -498,7 +517,7 @@ int handler::restart_rnd_next(byte *buf, byte *pos)
}
/* Set a timestamp in record */
/* Set a timestamp in record */
void handler::update_timestamp(byte *record)
{
@ -514,9 +533,10 @@ void handler::update_timestamp(byte *record)
return;
}
/* Updates field with field_type NEXT_NUMBER according to following:
** if field = 0 change field to the next free key in database.
*/
/*
Updates field with field_type NEXT_NUMBER according to following:
if field = 0 change field to the next free key in database.
*/
void handler::update_auto_increment()
{