🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.delphi.bazy-danych
Article #82894

Re: Co wybrac - Identity czy sekwencje

#82894
From: wloochacz
Date: Thu, 15 Feb 2018 10:32
20 lines
2348 bytes
W dniu 2018-02-15 o 09:09, zpksoft pisze:
> W dniu wtorek, 13 lutego 2018 12:24:43 UTC+1 użytkownik Pancio napisał:
/ciach/

> W ogóle nie używam identyfikatorów liczbowych. Wyłącznie łańcuchowe. Zero problemów. Jeśli masz wybór to zastanów się nad tym. Bardzo duże bazy są oparte tylko na takich identyfikatorach. Zobacz np. filmiki na Youtube: https://youtu.be/jOqktpxdGxg <- tu ID=jOqktpxdGxg. Nie muszą martwić się że gdzieś w sieci ktoś podwójnie zlicza ID. Dodatkowym atutem jest to że taki identyfikator tworzy klient więc może posłużyć się nim zanim wpisze rekord do bazy (!).

Jeżeli wartość takiego identyfikatora jest generowana jako rosnąca 
funkcja monotoniczna, to jest najgorsze z możliwych rozwiązań, jeśli 
idzie o wydajność.

Powoduje to poważne problemy z sortowaniem i fragmentacją indeksów. 
Chcesz mieć pofragmentowany indeks Primary Key - używaj takich 
identyfikatorów.

I właśnie dlatego np. w MS SQL jest specjalna funkcja do kreowania 
GUIDów sekwencyjnych:
https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequentialid-transact-sql

-- 
wloochacz
Technical Details
Message-ID: <5a8561ba$0$664$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!peer01.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
References: <b103c4b1-8620-403a-a902-5e4ecd5fe355@googlegroups.com> <b32fab82-19c1-452a-a5c8-45943fa76db7@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!peer01.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Subject: Re: Co wybrac - Identity czy sekwencje
Newsgroups: pl.comp.lang.delphi.bazy-danych
References: <b103c4b1-8620-403a-a902-5e4ecd5fe355@googlegroups.com> <b32fab82-19c1-452a-a5c8-45943fa76db7@googlegroups.com>
From: wloochacz <wloochacz@no.spam.gmail.com>
Date: Thu, 15 Feb 2018 11:32:24 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <b32fab82-19c1-452a-a5c8-45943fa76db7@googlegroups.com>
Lines: 20
Message-ID: <5a8561ba$0$664$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 83.21.27.211
X-Trace: 1518690746 unt-rea-a-01.news.neostrada.pl 664 83.21.27.211:54250
X-Complaints-To: abuse@news.neostrada.pl
X-Received-Body-CRC: 3407787206
X-Received-Bytes: 2267
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit