Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26617

Index can't used on table, and successfully after re create using other schema with same structure

    XMLWordPrintable

Details

    Description

      we have 2 database with same structure
      On this case database A can't used index when I run select query with specific where clause

      but on database B with same query index used smoothly

      I solved this issue with this step

      • Backup Table on Database A
      • Backup Data only on Database A
      • Drop table on Database A
      • create table on Database A using create script from Database B
      • import data

      after that table on Database A running using index

      CREATE TABLE `tgospfeed` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `company_id` varchar(50) DEFAULT '',
        `company_code` varchar(50) DEFAULT '',
        `owner` varchar(50) DEFAULT '',
        `receiver` varchar(50) DEFAULT '',
        `type` varchar(255) DEFAULT NULL,
        `content` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
        `picture` varchar(255) DEFAULT NULL,
        `flag` varchar(50) DEFAULT 'INBOX',
        `sent_notif` int(11) DEFAULT 0,
        `created_by` varchar(50) DEFAULT NULL,
        `created_date` datetime DEFAULT current_timestamp(),
        `modified_by` varchar(50) DEFAULT NULL,
        `modified_date` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
        PRIMARY KEY (`id`),
        KEY `idx_tgospfeed_company_id` (`company_id`),
        KEY `idx_tgospfeed_company_code` (`company_code`),
        KEY `idx_tgospfeed_receiver` (`receiver`),
        KEY `idx_tgospfeed_flag` (`flag`)
      ) ENGINE=InnoDB AUTO_INCREMENT=12916 DEFAULT CHARSET=utf8mb4
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            febridev febriyant
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.