Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Redmi Pad 2 9.7: ampio display, economico e peso contenuto, ma qualche limite nelle prestazioni
Redmi Pad 2 9.7: ampio display, economico e peso contenuto, ma qualche limite nelle prestazioni
Redmi Pad 2 9.7 punta su un display ampio e fluido, una batteria capace di accompagnare l'uso quotidiano senza ansie da ricarica e un prezzo accessibile, a partire da 179,90 euro per la versione con 64 GB di storage. Lo Snapdragon 6s 4G Gen 2 e i 4 GB di RAM della configurazione più diffusa frenano però chi cerca reattività e multitasking spinto: ecco il bilancio dopo due settimane di prova diretta
Peugeot Polygon Concept: ecco il futuro delle utilitarie
Peugeot Polygon Concept: ecco il futuro delle utilitarie
Polygon è la concept car di Peugeot che mostra il futuro delle soluzioni del segmento B: tra design compatti e innovativi affiancati da dimensioni compatte uno scherzo dalla manovrabilità incredibile per le manovre a bassa velocità
Reno16 Pro: il compatto di OPPO punta su fotocamera da 200MP e il nuovo Bubble! La recensione
Reno16 Pro: il compatto di OPPO punta su fotocamera da 200MP e il nuovo Bubble! La recensione
OPPO ha portato in Italia, dal 1° luglio 2026, Reno16 Pro: display AMOLED da 6,32 pollici a 144Hz, tripla fotocamera con sensore principale da 200 megapixel, chip Dimensity 8550 Super e batteria da 6000mAh, al prezzo di lancio di 899 euro. Lo abbiamo provato per due settimane insieme al nuovo accessorio Bubble, per capire se la formula compatta della serie regge ancora di fronte a un listino da 1099 euro
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


Redmi Pad 2 9.7: ampio display, economico e peso contenuto, ma qualche limite nelle prestazioni Redmi Pad 2 9.7: ampio display, economico e peso...
Peugeot Polygon Concept: ecco il futuro delle utilitarie Peugeot Polygon Concept: ecco il futuro delle ut...
Reno16 Pro: il compatto di OPPO punta su fotocamera da 200MP e il nuovo Bubble! La recensione Reno16 Pro: il compatto di OPPO punta su fotocam...
 Hisense 55U7SE: tuttofare e accessibile, il MiniLED per film, sport e gioco Hisense 55U7SE: tuttofare e accessibile, il Min...
Kindle Scribe Colorsoft: riduce le cornici e diventa a colori, ma il prezzo è alto Kindle Scribe Colorsoft: riduce le cornici e div...
Apple racconta il suo vantaggio nell'AI ...
Cisco Cloud Control, una cabina di regia...
Il software che controlla le Fab va in p...
Il settore tech è il primo bersag...
Windows 11, corretto un bug che poteva o...
X introduce nuove funzioni per i video c...
Blue Origin sta costruendo diversi lande...
DeepSeek avvia lo sviluppo di un chip pr...
Le offerte migliori ora su Amazon sugli ...
Fino a un petabit al secondo! Il piano d...
Cisco punta tutto sull'IA: tutti i 90.00...
Intel Nova Lake riporterà il supp...
Leapmotor B03X: al via gli ordini in Ita...
Nothing lancia i nuovi Ear (3a): l'audio...
Visa Intelligent Commerce: gli agenti di...
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:09.


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