Is columnMap required? Any benefits?

Are there any benefits using columnMap function when I don't need to change column names? In my project all column names are equal to properties.

Can I just drop columnMap function and leave it to Phalonc to generate it? Does this info stored in ModelMetadata?

    /**
     * Independent Column Mapping.
     */
    public function columnMap() {
        return array(
            'id' => 'id',
            'account_id' => 'account_id',
            'user_id' => 'user_id',
            'status_id' => 'status_id',
            'title' => 'title',
            'created' => 'created',
            'updated' => 'updated',
        );
    }

I think the only advantage is that Phalcon doesn't have to generate that property dynamically from the database, which could improve performance One can define all the model's meta data in a similar fashion.

Depending on the size of your database, the number of models you have, and the number of concurrent users you think you'll have - you may or may not notice the performance improvement. My strong suspicion is that you won't notice any change, so I'd not bother.

I just checked statistics on one of our projects where we don't cache the metadata. According to new relic, 1.4% of our transactions are locked up in describing tables for phalcons meta data for an average duration of .707ms

Category Segment % Time Avg calls (per txn) Avg time (ms

Database TABLES - SELECT 1.4 1.58 0.707

As quasi states you will most likely not notice a difference.

Ok, thank you for replies. If I make model metadata cache into MemCached / APC or alike. Does it solve the problem of DB describe queries?

Yes, because Phalcon won't need to query the database to get the meta data. The nice thing about this is you can basically turn it on & off in your bootstrap file.