Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Marathon: arriva il Fortnite hardcore
Marathon: arriva il Fortnite hardcore
Marathon è il titolo multiplayer competitivo del momento. Ecco quali sono le caratteristiche di gioco principali, insieme alle nostre prime considerazioni dopo qualche "run" nell'extraction shooter di Bungie
HP Imagine 2026: abbiamo visto HP IQ all’opera, ecco cosa può (e non può) fare
HP Imagine 2026: abbiamo visto HP IQ all’opera, ecco cosa può (e non può) fare
A New York HP ha messo al centro della scena HP IQ, la piattaforma di IA locale da 20 miliardi di parametri. L’abbiamo vista in funzione: è uno strumento che funziona, pensato per un target specifico, con vantaggi reali e limiti altrettanto evidenti
PNY RTX 5080 Slim OC, sembra una Founders Edition ma non lo è
PNY RTX 5080 Slim OC, sembra una Founders Edition ma non lo è
La PNY GeForce RTX 5080 Slim OC si distingue nel panorama delle GPU di fascia alta per il design compatto a due slot, ispirato alla NVIDIA GeForce RTX 5080 Founders Edition. In questo test analizziamo comportamento termico e prestazioni in gioco, valutando se il formato ridotto comprometta o meno l'esperienza complessiva rispetto alle soluzioni più ingombranti presenti sul mercato.
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 02-02-2003, 20:32   #1
dona
Member
 
L'Avatar di dona
 
Iscritto dal: Oct 2000
Messaggi: 198
foreign key su mysql

ciao , dovrei lavorare sul sorgente di mysql per provare a creare il supporto dei vincoli foreign key, per una futura tesi.

qualcuno sa darmi qualche dritta?
qualcuno sa dove posso reperire guide o chissa che sui sorgenti di mysql?

commenti o consigli sono di aiuto
dona è offline   Rispondi citando il messaggio o parte di esso
Old 03-02-2003, 09:43   #2
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Dal manuale di MySQL :

1.4.4.5 Foreign Keys

Note that foreign keys in SQL are not used to join tables, but are used mostly for checking referential integrity (foreign key constraints). If you want to get results from multiple tables from a SELECT statement, you do this by joining tables:

SELECT * from table1,table2 where table1.id = table2.id;

See section 6.4.1.1 JOIN Syntax. See section 3.5.6 Using Foreign Keys.

The FOREIGN KEY syntax in MySQL exists only for compatibility with other SQL vendors' CREATE TABLE commands; it doesn't do anything. The FOREIGN KEY syntax without ON DELETE ... is mostly used for documentation purposes. Some ODBC applications may use this to produce automatic WHERE clauses, but this is usually easy to override. FOREIGN KEY is sometimes used as a constraint check, but this check is unnecessary in practice if rows are inserted into the tables in the right order. MySQL only supports these clauses because some applications require them to exist (regardless of whether or not they work).

In MySQL, you can work around the problem of ON DELETE ... not being implemented by adding the appropriate DELETE statement to an application when you delete records from a table that has a foreign key. In practice this is as quick (in some cases quicker) and much more portable than using foreign keys.

In the near future we will extend the FOREIGN KEY implementation so that at least the information will be saved in the table specification file and may be retrieved by mysqldump and ODBC. At a later stage we will implement the foreign key constraints for application that can't easily be coded to avoid them.

1.4.4.6 Why We Did Not Implement Foreign Keys

Many database scholars and programmers feel very strongly that referential integrity should be enforced inside the database server. Indeed, in many cases, this approach is very helpful. However, in talking with many database users we have observed that foreign keys are often misused, which can cause severe problems. Even when used properly, it is not a magic solution for the referential integrity problem, although it does make things easier in some cases.

Because of the above observations, we did not assign implementing foreign keys a high priority. Our user base consisted of mostly of developers who did not mind enforcing referential integerity inside the application code, and in fact, preferred to do it that way because it gave them more control.

However, in the last couple of years, our user base has expanded a great deal and we now have many users who would like to have the enforced referential integrity support inside MySQL. So we will implement the foreign keys in the near future, although at this point we cannot provide a definite delivery date.

Some advantages of foreign key enforcement:

Assuming proper design of the relations, foreign key constraints will make it more difficult for a programmer to introduce an inconsistency into the database
Using cascading updates and deletes can simplify the client code
Properly designed foreign key rules aid in documenting relations between tables
Disadvantages:

MySQL does not yet support enforced referential integrity, so if your application depends on it, you will not be able to use it with MySQL until we implement this feature.
Mistakes, that are easy to make in designing key relations, can cause severe problems, for example, circular rules, or the wrong combination of cascading deletes.
A properly written application will make sure internally that it is not violating referential integrity constraints before proceding with a query. Thus, additionaly checks on the database level will only slow down performance for such application.
It is not uncommon for a DBA to make such a complex topology of relations that it becomes very difficult, and in some cases impossible to backup or restore individual tables.

Questa è la roadmap di MySQL...sembra che il supporto alle foreign keys sia già in fase di sviluppo...visto che siamo già alla versione alpha della 4.1...

Note that because we know the MySQL road map, we have included in the following table the version when MySQL should support this feature. Unfortunately we couldn't do this for previous comparison, because we don't know the PostgreSQL roadmap.

Feature MySQL version
Subselects 4.1
Foreign keys 4.0 and 4.1
Views 4.2
Stored procedures 4.1
Extensible type system Not planned
Unions 4.0
Full join 4.0 or 4.1
Triggers 4.1
Constrainst 4.1
Cursors 4.1 or 4.2
Extensible index types like R-trees R-trees are planned for 4.2
Inherited tables Not planned
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 03-02-2003, 09:50   #3
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Non vorrei darti una brutta notizia, ma MySQL supporta le Foreign Keys su database di tipo InnoDB...
Le tabelle InnoDB sono diverse da quelle di default (MyISAM)...ed usano le transazioni per mantenere le proprietà ACID...

http://www.mysql.com/doc/en/SEC450.html
cionci è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Marathon: arriva il Fortnite hardcore Marathon: arriva il Fortnite hardcore
HP Imagine 2026: abbiamo visto HP IQ all’opera, ecco cosa può (e non può) fare HP Imagine 2026: abbiamo visto HP IQ all’opera, ...
PNY RTX 5080 Slim OC, sembra una Founders Edition ma non lo è PNY RTX 5080 Slim OC, sembra una Founders Editio...
Wi-Fi 7 con il design di una vetta innevata: ecco il nuovo sistema mesh di Huawei Wi-Fi 7 con il design di una vetta innevata: ecc...
Core Ultra 7 270K Plus e Core Ultra 7 250K Plus: Intel cerca il riscatto ma ci riesce in parte Core Ultra 7 270K Plus e Core Ultra 7 250K Plus:...
GeForce RTX 3080 raffreddata con un diss...
Proofpoint mette in sicurezza gli agenti...
Annunci falsi su Bakeca con dati veri di...
Attenzione alla truffa dell'assegno di A...
Addio al mito delle batterie a stato sol...
400 milioni e un obiettivo ambizioso: Re...
TCL 2026: la tecnologia SQD-Mini LED arr...
Gli aggiornamenti arriveranno, ma non si...
Monopattini elettrici: addio "Far W...
Mistral AI raccoglie 830 milioni di doll...
Hacker iraniani di Handala violano la Gm...
Chi è Eddie Dalton: il cantante d...
OVHcloud mette l'Italia al centro della ...
Zeekr 007 GT sold out in Cina, si passa ...
Hisense QLED 4K da 98'' e 85'' con 144Hz...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 17:54.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v