16 Mart 2023 Perşembe

CREATE TABLE HASH partitioning

Giriş
Açıklaması şöyle. Sütun bir hash fonksiyonunda girdikten sonra dönen değer N kadar bölümlemeye ayrılır
HASH partitioning is when a partition is selected based on the value returned by a user-defined expression that operates on column values in rows to be inserted into the table. The function may consist of any expression valid in SQL that yields a non-negative integer value. An extension to this type, LINEAR HASH, is also available.
CREATE TABLE
Örnek
Şöyle yaparız
CREATE TABLE Sales (
  id INT NOT NULL,
  store_name VARCHAR(30),
  store_id INT
)
PARTITION BY HASH(store_id) PARTITIONS 4;
ALTER TABLE
Örnek
Şöyle yaparız
ALTER TABLE customers PARTITION BY HASH(store_id) PARTITIONS 4;


Hiç yorum yok:

Yorum Gönder

Soft Delete

Giriş Açıklaması  şöyle When using the soft delete mechanism on the database, you might run into a situation where a record with a unique co...