Results 1 to 4 of 4

Thread: PHP and Oracle and Longs

  1. #1

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765

    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?
    Don't Rate my posts.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765

    Re: PHP and Oracle and Longs

    Quote 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.)
    Don't Rate my posts.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: PHP and Oracle and Longs

    Quote 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
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width