PHPHub 迁移数据库文件中 nullable 和索引的问题

数据库字段设置可为null,对索引有性能影响吗?
网上搜到的很多答案都是说有性能影响的,并且不提示设置为null,
文件路径:database/migrateions/2016_07_03_021841_create_users_table.php
内容:

public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('github_id')->index();
            $table->string('github_url');
            $table->string('email')->nullable()->index();
            $table->string('name')->nullable()->index();
            $table->string('login_token')->nullable();
            $table->string('remember_token')->nullable();
            $table->enum('is_banned', ['yes',  'no'])->default('no')->index();
            $table->string('image_url')->nullable();
            $table->integer('topic_count')->default(0)->index();
            $table->integer('reply_count')->default(0)->index();
            $table->integer('follower_count')->default(0)->index();
            $table->string('city')->nullable();
            $table->string('company')->nullable();
            $table->string('twitter_account')->nullable();
            $table->string('personal_website')->nullable();
            $table->string('introduction')->nullable();
            $table->string('certification')->nullable();
            $table->integer('notification_count')->default(0);
            $table->string('github_name')->index();
            $table->string('real_name')->nullable();
            $table->string('linkedin')->nullable();
            $table->string('payment_qrcode')->nullable();
            $table->string('wechat_qrcode')->nullable();
            $table->string('avatar');
            $table->string('login_qr')->nullable();
            $table->string('wechat_openid')->nullable()->index();
            $table->string('wechat_unionid')->nullable()->index();
            $table->string('weibo_name')->nullable();
            $table->string('weibo_link')->nullable();
            $table->boolean('verified')->default(false)->index();
            $table->string('verification_token')->nullable();
            $table->enum('email_notify_enabled', ['yes',  'no'])->default('yes')->index();
            $table->string('register_source')->index();
            $table->timestamp('last_actived_at')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

这种设置为nullable并建有索引的会有问题吗?

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
讨论数量: 1

没有问题,非null的时候索引效率会比较高一点。

8年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!