MySQL 9.1.0
Source Code Documentation
Unique_on_insert Class Reference

Unique_on_insert – similar to above, but rejects duplicates on insert, not just on read of the final result. More...

#include <uniques.h>

Public Member Functions

 Unique_on_insert (uint size)
 
bool unique_add (void *ptr)
 Add row id to the filter. More...
 
bool init ()
 Initialize duplicate filter - allocate duplicate weedout tmp table. More...
 
void reset (bool reinit)
 Reset filter - drop all rowid records. More...
 
void cleanup ()
 Cleanup unique filter. More...
 

Private Attributes

uint m_size
 Element size. More...
 
TABLEm_table {nullptr}
 Duplicate weedout tmp table. More...
 

Detailed Description

Unique_on_insert – similar to above, but rejects duplicates on insert, not just on read of the final result.

To achieve this values are inserted into mem tmp table which uses index to detect duplicate keys. When memory buffer is full, tmp table is dumped to a disk-based tmp table.

Constructor & Destructor Documentation

◆ Unique_on_insert()

Unique_on_insert::Unique_on_insert ( uint  size)
inline

Member Function Documentation

◆ cleanup()

void Unique_on_insert::cleanup ( void  )

Cleanup unique filter.

◆ init()

bool Unique_on_insert::init ( void  )

Initialize duplicate filter - allocate duplicate weedout tmp table.

Returns
false initialization succeeded true an error occur

◆ reset()

void Unique_on_insert::reset ( bool  reinit)

Reset filter - drop all rowid records.

Parameters
reinitWhether to restart index scan

◆ unique_add()

bool Unique_on_insert::unique_add ( void *  ptr)

Add row id to the filter.

Parameters
ptrpointer to the rowid
Returns
false rowid successfully inserted true duplicate or error

Member Data Documentation

◆ m_size

uint Unique_on_insert::m_size
private

Element size.

◆ m_table

TABLE* Unique_on_insert::m_table {nullptr}
private

Duplicate weedout tmp table.


The documentation for this class was generated from the following files: