Timeline for Advice Needed for Post Meta Database Efficiency
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 16, 2012 at 9:12 | comment | added | Mridul Aggarwal | This performance gain will come at a cost of many headaches when trying to optimize custom queries. & any errors could make it even bad than postmeta. So you might let it be in postmeta itself, it may not be the best way but it won't be worst | |
Nov 16, 2012 at 9:08 | comment | added | Mridul Aggarwal | @Rick If your data contains booleans for instance, it will perform better in a boolean type column, integer in integer type column etc. If you have a term slug in one of the field, you could benefit from indexes when making custom queries in the future. It still comes to what data there is exactly. But assuming that all 20 fields are being actively used & that you optimize your custom tables schema, you will probably get better results with a separate table. Also disable querying postmeta for your post type | |
Nov 16, 2012 at 8:54 | comment | added | Mridul Aggarwal | This isn't really true with good table indexes. Exactly as i wrote- generally, not always | |
Nov 16, 2012 at 8:51 | comment | added | Mridul Aggarwal |
it may actually be more effective to use a custom table when dealing with specific data and leaving unknowns in wp_postmeta . I agree with you, what i meant was that mysql performs better in a table form when the size(in bytes) of data is big.
|
|
Nov 16, 2012 at 0:15 | comment | added | Adam | @totels Agree.. This slide presentation on MySQL refers to the very topic of optimized indexes and the large performance gains to be had. I recommend the whole presentation with regards to this question. | |
Nov 15, 2012 at 23:05 | comment | added | totels | It's generally faster to query to 1 row in a single table rather than 20 rows of meta information but there are somethings you should cosider ... This isn't really true with good table indexes, this is like saying "It's faster to determine the color of one blue car vs. 100 blue cars" | |
Nov 15, 2012 at 23:02 | comment | added | totels |
If the meta information are articles, then it's best to issue a separate query to another table. If they are small sentences, url's etc. then postmeta will work fine. wp_postmeta.meta_value is a longtext field, it may actually be more effective to use a custom table when dealing with specific data and leaving unknowns in wp_postmeta
|
|
Nov 15, 2012 at 22:36 | vote | accept | CommunityBot | ||
Nov 15, 2012 at 22:36 | comment | added | user23654 | Yeah all 20 fields are filled and currently i have around 2000 rows of data which means in the postmeta, I have 40,000 postmetas...so you can imagine when I get to 10000 posts...etc..The data for the values isn't large at all, just 10 or so characters each. So if the database can handle that efficiently, then I will go with using custom post type...If not, then I will create my own table.... | |
Nov 15, 2012 at 21:58 | history | answered | Mridul Aggarwal | CC BY-SA 3.0 |