Creating custom magento2 attribute can be a nuanced process, especially when it comes to attributes for the catalog and customer entities. As of the current version, the Magento community edition only facilitates the creation of product attributes directly from the
magento convert attribute type
As you know magento table structure is been built upon EAV (Entity Attribute Value) structure. Magento uses EAV to add more number of fields to table dynamically. Just to get one single record, Magento joins 4-5 tables to get data
Reindexing in magento programmatically
Good way to re-index data in magento without admin panel is SSH.Also I have been locked in admin panel and unable to reindex all data the SSH is the good practice to do.Sometime if we don’t have access to SSH