Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 19 wrz 2012 · My query would give you the count of indexes present on a table with a particular index_name. Based on that count, you can decide whether to issue a CREATE INDEX command or not. Tested on MySQL version 5.5. MariaDB supports IF NOT EXISTS syntax. You can use CREATE INDEX IF NOT EXISTS there.

    • If-not-exists

      I always was used following header in files that defined...

  2. IF EXISTS modifier is not built for DROP INDEX or CREATE INDEX yet. But you can check manually for the existence before creating/dropping an index. Use this sentence to check whether the index already exists. SHOW INDEX FROM table_name WHERE KEY_NAME = 'index_name'.

  3. CREATE INDEX enables you to add indexes to existing tables. CREATE INDEX is mapped to an ALTER TABLE statement to create indexes. See Section 15.1.9, “ALTER TABLE Statement”. CREATE INDEX cannot be used to create a PRIMARY KEY; use ALTER TABLE instead.

  4. The CREATE INDEX statement is used to create indexes in tables. Indexes are used to retrieve data from the database more quickly than otherwise. The users cannot see the indexes, they are just used to speed up searches/queries.

  5. In MySQL, you can use the "IF EXISTS" clause when creating or dropping an index to prevent an error from occurring if the index does not exist. To create an index with the "IF EXISTS" clause, you can use the following syntax: CREATE INDEX index_name ON table_name (column_name) IF NOT EXISTS;

  6. You must have the CREATE privilege for the table. By default, tables are created in the default database, using the InnoDB storage engine. An error occurs if the table exists, if there is no default database, or if the database does not exist. MySQL has no limit on the number of tables.

  7. I am trying to add an index to a table, but only if one doesn't exist. I don't know what the index name is. In the mysql manual I found the alter ignore command: ALTER [IGNORE] TABLE tbl_name

  1. Ludzie szukają również