Magento Themes and Magento Extensions

Usage of temporary tables in MySQL databases

Share
Posted on June 22nd, 2011 | Posted by admin

Hi! My recent project had some specific requirements regarding the work with database. Since DB server had some limitations (regarding number of queries), and fairly big number of queries that needed to be executed I created a solution that included temp tables. And now, I’d like to explain how to use them and why.

Suppose that in your application, you need to execute a calculation on a set of tables. The usual approach is to create a query that defines the joins between multiple tables, and selects the data from the joined tables. The problem with that approach is that every time you call that the query, the tables have to be rejoined in order to create the result. And that is usually fairly resource hungry. Instead, you can get around the problem by putting the results into temporary table, so the values are there while the database connection lasts.

Usage of database stored procedures

Share
Posted on June 19th, 2011 | Posted by admin

Hello guys. Today I’ll try to explain 2 things. First WHY to use stored procedures. And second, HOWto use them. First of all, a small notice. I’ll explain the subject on PostgreSQL example, because of the fact that I used that language syntax most recently.

So let’s begin with the question “Why?“.

Depending on the client’s needs and his limitations sometimes you need to use them to decrease the number of queries to a minimum. An example of that is if you have a situation of network overhead, stored procedures come in handy to minimize the network traffic. Or on the other hand, sometimes you just need to move some of the database logic to a DB side. A good example of that would be if you have a “Cron job” that will clean (truncate) some of the database’s tables.

My example would be based on that specific case, because it will cover some of the most used features and capabilities of PL/pgSQL (SQL procedural language).

How to transfer large Magento database from live to development server and other way round

Share
Posted on May 9th, 2011 | Posted by admin

I have been involved in Magento development for almost a year now. God knows I had (and still have) my moments of pain with it . If you are in professional, everyday, PHP development that focuses mainly on Magento then your life probably isn’t all flowers and bees. Magento is extremely rich eCommerce platform, but its main downside IMHO is its size and code complexity. If you download Magento via SVN, you will sound find out it has around 11 600 and more files. This is no small figure. Transferring that much of files over the FTP can be a real night mare. Luckily we have SSH and tar command to handle this really neat.

connect2MAGE | WordPress plugin for easy Magento database connection

Share
Posted on May 8th, 2011 | Posted by admin

WordPress plugin for easy Magento database connection

Hi everyone. I wrote this little plugin while working on one of our projects. If you know your way around WordPress then you know what $wpdb variable stands for. Imagine the following scenario. You have WordPress installation on one database, Magento on another. You know your way around SQL. You can always make new object based on WPDB class inside your template files giving it database access parameters, or you can use this plugin and use $MAGEDB the same way you use $wpdb.

Below is a little example of using $MAGEDB to connect to Magento database and retrieve some products by reading id’s from custom field of some post inside your WordPress.

Place this code inside one of your templates, like single.php.

Magento MySQL database diagram

Share
Posted on May 6th, 2011 | Posted by admin

If you worked with osCommerce, Zen Cart, CRE Loaded or any similar eCommerce platform before, you might find  Magento database structure quite confusing when you see it for the first time. I advise you not to rush too much figuring out what is what by glancing through database. Try to spend first few hours getting familiar with some background. For purposes of flexibility, the Magento database heavily utilizes an Entity-Attribute-Value (EAV) data model. As is often the case, the cost of flexibility is complexity. Is there something in Magento that is simple from developers point of view?

Page 2 of 2«12