[wp-hackers] Use of ENGINE=MEMORY w/ dbDelta() possible?
DD32
wordpress at dd32.id.au
Sun Mar 23 22:49:34 GMT 2008
Theres a mysql memory object cache allready available, you may want to take a look at that:
http://dd32.id.au/files/wordpress/object-cache-memcache.txt
(Though it doesnt create the table for you)
On Mon, 24 Mar 2008 04:02:24 +1100, Mahmoud Al-Qudsi <computerguru at neosmart.net> wrote:
> For my extension to the object-cache, I'd like to stick values in a memory-based table for optimum performance. Would this code give any problems on particular configurations?
>
> ************BEGIN CODE************
> $sql="
> CREATE TABLE mysql_cache (
> `key` varchar NOT NULL,
> `value` VARCHAR DEFAULT NULL,
> PRIMARY KEY(`key`)
> )
> ENGINE=MEMORY
> PACK_KEYS=1;
> ";
>
> require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
> dbDelta($sql);
> *************END CODE*************
>
>
> **My Reasons**
>>From the MySQL documentation:
> "[Memory engine is an] Extremely fast memory-based storage engine that uses hash indices."
>
>>From the MySQL documentation:
> "[PACK_KEYS=1: ] This usually makes updates slower and reads faster."
>
> I just want to make sure that the dbdelta() function won't give me any issues w/ this code. It won't be of any use without the ENGINE=MEMORY bit, so I might have to force it with $wpdb->query directly.
>
> Thanks!
>
> -Mahmoud
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list