<commit_before>.. _ref-databases:

===============================
Notes about supported databases
===============================

Django attempts to support as many features as possible on all database
backends. However, not all database backends are alike, and we've had to make
design decisions on which features to support and which assumptions we can make
safely.

This file describes some of the features that might be relevant to Django
usage. Of course, it is not intended as a replacement for server-specific
documentation or reference manuals.

.. _mysql-notes:

MySQL notes
===========

Django expects the database to support transactions, referential integrity,
and Unicode support (UTF-8 encoding). Fortunately, MySQL_ has all these
features as available as far back as 3.23. While it may be possible to use
3.23 or 4.0, you'll probably have less trouble if you use 4.1 or 5.0.

MySQL 4.1
---------

`MySQL 4.1`_ has greatly improved support for character sets. It is possible to
set different default character sets on the database, table, and column.
Previous versions have only a server-wide character set setting. It's also the
first version where the character set can be changed on the fly. 4.1 also has
support for views, but Django currently doesn't use views.

MySQL 5.0
---------

`MySQL 5.0`_ adds the ``information_schema`` database, which contains detailed
data on all database schema. Django's ``inspectdb`` feature uses this
``information_schema`` if it's available. 5.0 also has support for stored
procedures, but Django currently doesn't use stored procedures.

.. _MySQL: http://www.mysql.com/
.. _MySQL 4.1: http://dev.mysql.com/doc/refman/4.1/en/index.html
.. _MySQL 5.0: http://dev.mysql.com/doc/refman/5.0/en/index.html

Storage engines
---------------

MySQL has several `storage engines`_ (previously called table types). You can
change the default storage engine in the server configuration.

The default engine is MyISAM_. The main drawback of MyISAM is that it doesn't
currently support transactions or foreign keys. On the plus side, it's
currently the only engine that supports full-text indexing and searching.

The InnoDB_ engine is fully transactional and supports foreign key references.

The BDB_ engine, like InnoDB, is also fully transactional and supports foreign
key references. However, its use seems to be deprecated.

`Other storage engines`_, including SolidDB_ and Falcon_, are on the horizon.
For now, InnoDB is probably your best choice.

.. _storage engines: http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html
.. _MyISAM: http://dev.mysql.com/doc/refman/5.0/en/myisam-storage-engine.html
.. _BDB: http://dev.mysql.com/doc/refman/5.0/en/bdb-storage-engine.html
.. _InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb.html
.. _Other storage engines: http://dev.mysql.com/doc/refman/5.1/en/storage-engines-other.html
.. _SolidDB: http://forge.mysql.com/projects/project.php?id=139
.. _Falcon: http://dev.mysql.com/doc/falcon/en/index.html

MySQLdb
-------<commit_msg>Fixed #8964 -- Added a note that MyISAM may not necessarily be the default storage engine for MySQL. Some packagers seem to like causing confusion.<commit_after>.. _ref-databases:

===============================
Notes about supported databases
===============================

Django attempts to support as many features as possible on all database
backends. However, not all database backends are alike, and we've had to make
design decisions on which features to support and which assumptions we can make
safely.

This file describes some of the features that might be relevant to Django
usage. Of course, it is not intended as a replacement for server-specific
documentation or reference manuals.

.. _mysql-notes:

MySQL notes
===========

Django expects the database to support transactions, referential integrity,
and Unicode support (UTF-8 encoding). Fortunately, MySQL_ has all these
features as available as far back as 3.23. While it may be possible to use
3.23 or 4.0, you'll probably have less trouble if you use 4.1 or 5.0.

MySQL 4.1
---------

`MySQL 4.1`_ has greatly improved support for character sets. It is possible to
set different default character sets on the database, table, and column.
Previous versions have only a server-wide character set setting. It's also the
first version where the character set can be changed on the fly. 4.1 also has
support for views, but Django currently doesn't use views.

MySQL 5.0
---------

`MySQL 5.0`_ adds the ``information_schema`` database, which contains detailed
data on all database schema. Django's ``inspectdb`` feature uses this
``information_schema`` if it's available. 5.0 also has support for stored
procedures, but Django currently doesn't use stored procedures.

.. _MySQL: http://www.mysql.com/
.. _MySQL 4.1: http://dev.mysql.com/doc/refman/4.1/en/index.html
.. _MySQL 5.0: http://dev.mysql.com/doc/refman/5.0/en/index.html

Storage engines
---------------

MySQL has several `storage engines`_ (previously called table types). You can
change the default storage engine in the server configuration.

The default engine is MyISAM_ [#]_. The main drawback of MyISAM is that it
doesn't currently support transactions or foreign keys. On the plus side, it's
currently the only engine that supports full-text indexing and searching.

The InnoDB_ engine is fully transactional and supports foreign key references.

The BDB_ engine, like InnoDB, is also fully transactional and supports foreign
key references. However, its use seems to be deprecated.

`Other storage engines`_, including SolidDB_ and Falcon_, are on the horizon.
For now, InnoDB is probably your best choice.

.. _storage engines: http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html
.. _MyISAM: http://dev.mysql.com/doc/refman/5.0/en/myisam-storage-engine.html
.. _BDB: http://dev.mysql.com/doc/refman/5.0/en/bdb-storage-engine.html
.. _InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb.html
.. _Other storage engines: http://dev.mysql.com/doc/refman/5.1/en/storage-engines-other.html
.. _SolidDB: http://forge.mysql.com/projects/project.php?id=139
.. _Falcon: http://dev.mysql.com/doc/falcon/en/index.html

.. [#] Unless this was changed by the packager of your MySQL package. We've
   had reports that the Windows Community Server installer sets up InnoDB as
   the default storage engine, for example.

MySQLdb
-------
{'fraction_non_alphanumeric': 0.11659122834399875, 'fraction_numerical': 0.014983611674730763, 'mean_word_length': 3.9635941130906276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2811862', 'n_tokens_mistral': 1899, 'n_tokens_neox': 1793, 'n_words': 773}