| | |
Adding a page - Trick behind
Thread Solved |
When you add a page in CMS (Like Wordpress' admin) what does it actually do? Add predefined table? Or what?
Thanks!
Thanks!
Atheist: God is man made imagination, he doesn't exist!
Theist: It's okay, can you imagine anything else that doesn't exist?
"Try to be expert in everything and you become expert in nothing" - Me
---------------------------------
Windows Vista Home Premium SP2| MINGW 4.4.0|PHP 5.3.1|Python 2.6.4|JDK 1.6
Theist: It's okay, can you imagine anything else that doesn't exist?
"Try to be expert in everything and you become expert in nothing" - Me
---------------------------------
Windows Vista Home Premium SP2| MINGW 4.4.0|PHP 5.3.1|Python 2.6.4|JDK 1.6
1
#2 Nov 22nd, 2009
Hey.
In a properly designed CMS, changing anything just INSERTs, UPDATEs or DELETEs stuff from the database. If it is actually creating tables, or otherwise changing the database structure, there is usually something wrong with the database design.
Exceptions to this are webs with insane numbers of visitors, where the tables get so big they become unmanageable and start affecting performance. (I'm talking here about websites the size of Facebook or the WordPress blog. If you are wondering if this applies to your web, it almost definitely doesn't ;-P)
But yea, not really knowing much about the WordPress system itself, I would suspect that adding a page just INSERTs a row into a "page" table somewhere, and the contents of that page get inserted with it, or into a table related to it.
In a properly designed CMS, changing anything just INSERTs, UPDATEs or DELETEs stuff from the database. If it is actually creating tables, or otherwise changing the database structure, there is usually something wrong with the database design.
Exceptions to this are webs with insane numbers of visitors, where the tables get so big they become unmanageable and start affecting performance. (I'm talking here about websites the size of Facebook or the WordPress blog. If you are wondering if this applies to your web, it almost definitely doesn't ;-P)
But yea, not really knowing much about the WordPress system itself, I would suspect that adding a page just INSERTs a row into a "page" table somewhere, and the contents of that page get inserted with it, or into a table related to it.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
0
#3 Nov 22nd, 2009
•
•
•
•
Hey.
In a properly designed CMS, changing anything just INSERTs, UPDATEs or DELETEs stuff from the database. If it is actually creating tables, or otherwise changing the database structure, there is usually something wrong with the database design.
Exceptions to this are webs with insane numbers of visitors, where the tables get so big they become unmanageable and start affecting performance. (I'm talking here about websites the size of Facebook or the WordPress blog. If you are wondering if this applies to your web, it almost definitely doesn't ;-P)
But yea, not really knowing much about the WordPress system itself, I would suspect that adding a page just INSERTs a row into a "page" table somewhere, and the contents of that page get inserted with it, or into a table related to it.
Try not to bump 10 year old topics as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. -- Jumba webhosting
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` Want 1 on 1 php help, add me to msn at msn@cwarn23.infoMy favourite PC. -- Jumba webhosting
0
#4 Nov 22nd, 2009
•
•
•
•
Well actually I have been told in the mysql forum that if you design a table so that it has indexing you shouldn't ever need multiple tables for the one job.
However, I am talking about websites like Facebook and WordPress, who get more hits per day than all of our websites combined are likely to get in our lifetimes. Where the index "tables" are so large they would have to have index tables of their own to get any decent query times.
But those are extreme cases. Only apply to people that measure the hourly database size increase in Terabytes :-)
•
•
•
•
In case you don't know what table indexing is table indexing is one of the options when creating each table column in phpmyadmin.
12.1.13. CREATE INDEX Syntax
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
0
#5 Nov 22nd, 2009
•
•
•
•
But those are extreme cases. Only apply to people that measure the hourly database size increase in Terabytes :-)
Try not to bump 10 year old topics as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. -- Jumba webhosting
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` Want 1 on 1 php help, add me to msn at msn@cwarn23.infoMy favourite PC. -- Jumba webhosting
0
#6 Nov 23rd, 2009
Thanks guys for inputs. It seems to me that there are many ways of doing the same 
What do you guys suggest, suppose you were to do it?

What do you guys suggest, suppose you were to do it?
Atheist: God is man made imagination, he doesn't exist!
Theist: It's okay, can you imagine anything else that doesn't exist?
"Try to be expert in everything and you become expert in nothing" - Me
---------------------------------
Windows Vista Home Premium SP2| MINGW 4.4.0|PHP 5.3.1|Python 2.6.4|JDK 1.6
Theist: It's okay, can you imagine anything else that doesn't exist?
"Try to be expert in everything and you become expert in nothing" - Me
---------------------------------
Windows Vista Home Premium SP2| MINGW 4.4.0|PHP 5.3.1|Python 2.6.4|JDK 1.6
0
#7 Nov 23rd, 2009
•
•
•
•
Thanks guys for inputs. It seems to me that there are many ways of doing the same
What do you guys suggest, suppose you were to do it?

I suggest you go with the method I mentioned in my first post; creating a 'page' table, in which you add a row for each new page.
•
•
•
•
Are you at all familiar with the mediawiki cms. That is the same cms wikipedia uses and it does not spread into millions of tables.
•
•
•
•
Instead it has hundreds of computers that just process the database. These are known as cache servers.
They can be very useful for websites like Wikipedia and YouTube, who's content is generally pretty static, but aren't really of much use to websites like Facebook, who's content changes on pretty much every request.
All of these huge websites more than likely use cluster servers tho (or something equivalent), which distributes the load of a single database between a network of computers. That sounds more like what you are talking about.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
0
#8 Nov 23rd, 2009
•
•
•
•
They can be very useful for websites like Wikipedia and YouTube, who's content is generally pretty static, but aren't really of much use to websites like Facebook, who's content changes on pretty much every request.
Just something I should have said earlier...
If placing all the data in one table, it is often best to put the big column and a few identifiers in one table then the rest of the columns in another table and use join statements instead of having all the columns in the one table. So Basically there would be two tables one with the page data and the other with little bits of info and this can speed things up when you only need the little bits of info. Just how I saw mediawiki do it.
Well that is my opinion but others have different views...
Try not to bump 10 year old topics as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. -- Jumba webhosting
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` Want 1 on 1 php help, add me to msn at msn@cwarn23.infoMy favourite PC. -- Jumba webhosting
0
#9 Nov 23rd, 2009
•
•
•
•
Just something I should have said earlier...
If placing all the data in one table, it is often best to put the big column and a few identifiers in one table then the rest of the columns in another table and use join statements instead of having all the columns in the one table. So Basically there would be two tables one with the page data and the other with little bits of info and this can speed things up when you only need the little bits of info. Just how I saw mediawiki do it.
It's best to identify the columns you don't need on a regular basis and move them out. Like say; in a forum system, it would be a good idea to pull the actual forum post out of the main 'post' table and make the post title a fix-length column.
That way the only columns in the 'post' tables would be fixed-length columns, which is much faster to load under heavy loads, and on a typical forum, the most resource draining requests are those that request lists of topics, for which the actual text of the post is not needed.
•
•
•
•
Just a note on that. Wikipedia receives 1,000 new articles every day and many more edited articles so it is possible to compare Wikipedia to ever changing websites such as Facebook.
And even tho new articles get added to a Wiki, if the cache servers are working correctly, the overhead to the database should be minimal. The page is added, and the first time it is requested the cache servers cache the output, from where it is relayed to the next couple of hundred requesters.
The actual database is only queried once while the content remains the same, or until a specific cache-time-limit has passed, which on a web the size of Wikipedia could be hundreds or thousands of requests.
On a scale of static to 100% dynamic - the latter being Facebook - Wikipedia is much closer to the static end, really. The same goes for most blog/news sites.
Anyways. What were we talking about again? I think we are getting a bit carried away xD
I only mentioned the split table thing to point out the exception to the rule

•
•
•
•
I guess it is a matter of personal preference but to me it doesn't make much of a difference because the data is still stored in the same source file. That is each database has a separate file and so having a separate table will not make a too greater difference if it needs to search from a list of a million tables.
And this is only relevant to InnoDB tables. MyISAM tables are each stored in three separate files, so this in no way applies to them.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
0
#10 Nov 23rd, 2009
•
•
•
•
This is the default behavior, yes, but you can change it. See: 13.6.2.1. Using Per-Table Tablespaces
And this is only relevant to InnoDB tables. MyISAM tables are each stored in three separate files, so this in no way applies to them.
However from reading what Atli has to say using correct mysql methods with many tables should also do the job.
Try not to bump 10 year old topics as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. -- Jumba webhosting
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` Want 1 on 1 php help, add me to msn at msn@cwarn23.infoMy favourite PC. -- Jumba webhosting
![]() |
Similar Threads
- FAVOURITE & HOME ICON on WEB PAGE (JavaScript / DHTML / AJAX)
- Can I use a template html page within another html page (Site Layout and Usability)
- Looking for one page search layout design ideas (Site Layout and Usability)
- How do you create this... (Site Layout and Usability)
- Need help with adding a page hit counter that uses the Application Bean (JSP)
- Need help reducing flicker on a web page (ASP.NET)
- Page border (DaniWeb Community Feedback)
- ?Adding a thank you page to a form? (Site Layout and Usability)
Other Threads in the PHP Forum
- Previous Thread: I a php script that can restrict a user from adding additional image to his account o
- Next Thread: need php code to send sms to mobile
Views: 834 | Replies: 12
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache array box buttons cakephp cart check checkbox class cms code combobox cookies css database date delete directory display download dropdown drupal dynamic echo email error file files folder form forms function functions header href htaccess html image include insert ip java javascript joomla limit link login lookup loop mail menu methods mlm mod_rewrite multiple mysql order output parse password paypal php problem query radio random recursion redirect regex remote rows script search security select server session sessions sort source sql string table unicode update updates upload url user validation variable video web website wordpress xml zend






