Magento Indexer Not Adding Attribute to flat table in custom attribute

You need to enable visible_on_front to push into the Catalog Flat tables. Category flat tables are affected by used_in_product_listing.

As for the limit in MySQL I believe that is a separate question and should be migrated out as a separate Q&A.


Another way to add attributes to flat tables is to set them in your config.xml frontend section ...

<product>
    <collection>
        <attributes>
            <attribute_code/>
        </attributes>
    </collection>
</product>

For me it was enough to set only "used_in_product_listing" => true

'attribute_code' => array(
    'type'                          => 'int',
    'input'                         => 'select',
    'global'                        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'required'                      => 0,
    'is_configurable'               => 0,
    'visible_in_advanced_search'    => 0,
    'comparable'                    => 0,
    'is_html_allowed_on_front'      => 0,
    'user_defined'                  => 1,
    'used_in_product_listing'       => 1,
    'source'                        => 'eav/entity_attribute_source_boolean',
)

and run catalog_product_flat reindex to get product attribute in flat table:

php shell/indexer.php --reindex catalog_product_flat