|
-
Feb 7th, 2005, 09:59 PM
#1
Thread Starter
PowerPoster
PHP and Oracle and Longs
Hey guys... working on forum software with an Oracle backend, and I've noticed some weird loading times between MySQL and Oracle when it comes to large text fields. Probably belong in a few forums, but meh. 
At the moment I have it as a Long field, which seems to take about 0.040 per record... so if I try and have 15 posts per page, then its gunna take a while. With MySQL, it handled it really easily... thus my confusion.
I was using a Blob field, but that was even slower still. Any ideas?
-
Feb 8th, 2005, 03:15 AM
#2
Re: PHP and Oracle and Longs
Have you made sure that the table has an index? Usually the index is on the same field you made the rimary key. Also do not put any indexes on variable length text fields as they can slow things down too.
-
Feb 8th, 2005, 06:50 AM
#3
Thread Starter
PowerPoster
Re: PHP and Oracle and Longs
 Originally Posted by visualAd
Have you made sure that the table has an index? Usually the index is on the same field you made the rimary key. Also do not put any indexes on variable length text fields as they can slow things down too.
The post id is the primary key as far as I can tell. Sql Plus doesn't show the primary key, but I think I've got into the habit of setting the primary keys.
I dunno, I was under the impression that Oracle was faster than MySQL (thus why it was more expensive.)
-
Feb 8th, 2005, 11:15 AM
#4
Re: PHP and Oracle and Longs
 Originally Posted by Pc_Madness
The post id is the primary key as far as I can tell.
For it to be a real primary key you must create a primary index on the field. This identifies to Oracle that the field is to be unique for all records and indexes the values.
Here's a link to the section on indexes in the Oracle Admins guide on the management of indexes.
MySql is a faster database, but it does lack some of the powerful features included by Oracle. The trick is to ensure your table is properly indexed. I once had a table in MySql which had 100,000 records - without indexes a typical qurey took about 5 mins. When I indexed the foreign key and primary key fields this time went down to 0.1 seconds.
http://www-rohan.sdsu.edu/doc/oracle...1/ch14.htm#217
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|