What is efficient, Oracle or MySQL in PHP? Help !

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

What is efficient, Oracle or MySQL in PHP? Help !

Post by phazorRise »

I'm a newbie. I have some plans about desiging an application in PHP. So I want to know the best Database for PHP.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by Darhazer »

phazorRise wrote:I'm a newbie. I have some plans about desiging an application in PHP. So I want to know the best Database for PHP.
Better think about the best database for your application, not for the programming language :)
MySQL is the most popular one, but PHP have drivers for a lot of databases and I've been using PostgreSQL with PHP in many projects
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by phazorRise »

i want to store large amount of data in a field. So Oracle provides LOB , is it available in MySQL?
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by Darhazer »

it provides TEXT for storing large amounts of text and BLOB (binary large object) to store binary data.
It can handle up to 4 GB (LARGE BLOB), 16 MB (MEDIUM BLOB), 64K (BLOB) or 256 bytes (TINY BLOB)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by Benjamin »

phazorRise wrote:i want to store large amount of data in a field.
What sort of data are you storing?
How will you use the data in the view?
How will you search for and retrieve the data?
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by phazorRise »

Darhazer wrote:it provides TEXT for storing large amounts of text and BLOB (binary large object) to store binary data.
It can handle up to 4 GB (LARGE BLOB), 16 MB (MEDIUM BLOB), 64K (BLOB) or 256 bytes (TINY BLOB)

Thanx for info. i'll try to work with these. :)
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by phazorRise »

Benjamin wrote:
phazorRise wrote:i want to store large amount of data in a field.
What sort of data are you storing?
How will you use the data in the view?
How will you search for and retrieve the data?
I'm want to store text and images in database.
Searching will be done using AND, OR, NOT ie boolean searchig and nested clauses using queries.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by Benjamin »

phazorRise wrote:Searching will be done using AND, OR, NOT ie boolean searchig and nested clauses using queries.
How exactly will you be performing AND, OR, NOT queries on fulltext and binary data?
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by phazorRise »

Benjamin wrote:
phazorRise wrote:Searching will be done using AND, OR, NOT ie boolean searchig and nested clauses using queries.
How exactly will you be performing AND, OR, NOT queries on fulltext and binary data?

i'll search it along with some other condition like according to 'ID' assigned with each record.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by Benjamin »

Define "it". A row in a table is comprised of multiple fields. What field will you be using to retrieve the record?
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by phazorRise »

Benjamin wrote:Define "it". A row in a table is comprised of multiple fields. What field will you be using to retrieve the record?
A row is consist of many fields. And each row is having one unique field like primary key ie ID with numeric value.
It will be incremented when a record is added. And for searching, I planned searching by this ID. If ID matches then from requested field data will be retrieved. Now this data is supposed to be fulltext or an image.

Do you think this is efficient way? Thank you for valuable time!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by Benjamin »

If you are simply pulling the data using the id (primary key), I would recommend storing the path to the data in a varchar field instead of the actual data. This will reduce the load on the database server and allow you to access the data using the direct io functions of the operating system. Reference file_get_contents, file_put_contents and fopen (http://us.php.net/manual/en/function.fopen.php).

In other words, storing the data as files rather than in a MySQL table will save a lot of overhead and increase performance.
User avatar
phazorRise
Forum Contributor
Posts: 134
Joined: Mon Dec 27, 2010 7:58 am

Re: What is efficient, Oracle or MySQL in PHP? Help !

Post by phazorRise »

Benjamin wrote:If you are simply pulling the data using the id (primary key), I would recommend storing the path to the data in a varchar field instead of the actual data. This will reduce the load on the database server and allow you to access the data using the direct io functions of the operating system. Reference file_get_contents, file_put_contents and fopen (http://us.php.net/manual/en/function.fopen.php).

In other words, storing the data as files rather than in a MySQL table will save a lot of overhead and increase performance.
I have designed a site in ASP as a mini-project for university. And in that, I used text files to store large amount of text and images of users were stored under a comman directory. I applied same logic as you've suggested. MDB was having fields just store the paths of these files. While retrieving I simply picked up these paths.

Even for this application also I was about about to do the same. But thought MySQL have something special for such case.

I'll give it a shot about what you've suggested.
Post Reply