Hey guys,
I tested
$customers = Customer::find();
print_r($customers->count()); exit;
on a table with 5804011 rows and 1.4 GiB of data
The model for this table was generated by console - phalcon model ...
- PHP 5.5.15-1~dotdeb.1 (cli) (built: Jul 24 2014 16:44:04)
- mysql Ver 14.14 Distrib 5.5.38, for debian-linux-gnu (x86_64) using readline 6.2
- Linux Debian 7.0
- Phalcon 1.3.3
- memory_limit = 512M
Everything worked fine :)
CREATE TABLE customer
(
country
char(2) NOT NULL,
id
int(10) unsigned NOT NULL AUTO_INCREMENT,
customer_id
int(11) unsigned DEFAULT NULL,
locale
varchar(5) NOT NULL,
email
varchar(128) NOT NULL,
first_name
varchar(64) DEFAULT NULL,
last_name
varchar(64) DEFAULT NULL,
gender
tinyint(3) unsigned DEFAULT NULL,
date_of_birth
datetime DEFAULT NULL,
birthday_date
datetime DEFAULT NULL,
password_encryption_type
char(10) DEFAULT NULL,
password_hash
varchar(64) DEFAULT NULL,
registration_uri
varchar(255) DEFAULT NULL,
registration_ip
varchar(16) DEFAULT NULL,
confirmation_hash
varchar(255) DEFAULT NULL,
confirmation_ip
varchar(16) DEFAULT NULL,
activation_date
datetime DEFAULT NULL,
last_login
datetime DEFAULT NULL,
login_count
int(11) DEFAULT NULL,
corporate_code
varchar(32) DEFAULT NULL,
referrer_id
int(10) unsigned DEFAULT '0',
affiliate_id
int(10) unsigned DEFAULT NULL,
tradedoubler_uid
varchar(32) DEFAULT NULL,
default_billing_address_id
int(10) unsigned DEFAULT NULL,
default_shipping_address_id
int(10) unsigned DEFAULT NULL,
newsletter_subscription_type
tinyint(3) unsigned DEFAULT NULL,
email_change_address
varchar(128) DEFAULT NULL,
email_change_ip
varchar(16) DEFAULT NULL,
email_change_date
datetime DEFAULT NULL,
email_change_confirmation_date
datetime DEFAULT NULL,
complaints
smallint(5) unsigned DEFAULT '0',
bounces
smallint(5) unsigned DEFAULT '0',
soft_bounces
smallint(5) unsigned DEFAULT '0',
hard_bounces
smallint(5) unsigned DEFAULT '0',
block_bounces
smallint(5) unsigned DEFAULT '0',
is_half_registered
tinyint(3) unsigned DEFAULT NULL,
has_uncanceled_orders
tinyint(3) unsigned DEFAULT NULL,
is_created_in_admin
tinyint(3) unsigned DEFAULT '0',
is_active
tinyint(3) unsigned NOT NULL DEFAULT '1',
created_at
datetime DEFAULT NULL,
modified_at
datetime DEFAULT NULL,
first_purchase
datetime DEFAULT NULL,
last_purchase
datetime DEFAULT NULL,
is_buyer
tinyint(1) DEFAULT '0',
is_deleted
tinyint(3) unsigned NOT NULL DEFAULT '0',
has_accepted
tinyint(4) NOT NULL DEFAULT '0' COMMENT '1 = cookies policy',
manual_fidelity_score
smallint(5) unsigned DEFAULT NULL,
system_fidelity_score
smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (id
),
UNIQUE KEY i_email_country
(email
,country
),
UNIQUE KEY i_country_customer_id
(country
,customer_id
),
KEY i_created_at
(created_at
),
KEY i_referrer_id
(referrer_id
),
KEY i_customer_id
(customer_id
),
KEY i_email_change_address
(email_change_address
),
KEY i_is_active
(is_active
),
KEY i_is_deleted
(is_deleted
),
KEY is_buyer
(is_buyer
),
KEY first_purchase
(first_purchase
),
KEY last_purchase
(last_purchase
),
KEY i_modified_at
(modified_at
)
) ENGINE=InnoDB AUTO_INCREMENT=6718314 DEFAULT CHARSET=utf8;