 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHPMaster.com: MongoDB Indexing, Part 2
by Chris Cornutt May 13, 2013 @ 10:36:46
PHPMaster.com has posted part two of their series looking at indexing in MongoDB databases (part one here) with some more advanced concepts Mongo makes available.
In part 1 of this series we had an introduction to indexing in MongoDB. we saw how to create, use, and analyze queries with indexes giving us a good foundation to build on. In this part, we'll take a look at a few more small but important concepts, like indexing on sub-documents and embedded fields, covered queries, and index direction.
They use the same "posts" collection from the previous article, showing you how to index it based on a "location" sub document and "embedded fields" inside of it. They also touch on complex sorting with a multi-field index and the idea of "covered queries." These are queries that all fields queried are part of an index as well as all returned. They finish up the article by showing you how to remove indexes too.
voice your opinion now!
mongodb index tutorial example series query
PHPMaster.com: MongoDB Indexing, Part 1
by Chris Cornutt May 06, 2013 @ 11:50:44
New on PHPMaster.com is the first part of their series about indexing in MongoDB, a method for optimizing your collections to make querying them even faster. They cover the five main types of indexes and situations where they can help.
Indexing is one of the more important concepts of working with MongoDB. A proper understanding is critical because indexing can dramatically increase performance and throughput by reducing the number of full documents to be read, thereby increasing the performance of our application. Because indexes can be bit difficult to understand, this two-part series will take a closer look at them.
They look at the default "_id" index, secondary, compound, multikey and multikey compound indexes. Example documents and results are included as well as some of the options that can be set on the index types to tweak performance. They finish up the article with a look at some of the limitations and considerations to think about when using indexing, including that they cannot be used with regex queries.
voice your opinion now!
mongodb index tutorial example document query series
Alex Bilbie: Introducing MongoQB
by Chris Cornutt November 16, 2012 @ 09:38:38
Alex Bilbie has passed along a link to a project he's been working on to try to simplify access to MongoDB databases from PHP - his MongoQB library:
A few years ago I released a MongoDB library for the CodeIgniter PHP framework which has become quite popular thanks to it's likeness to CodeIgniter's query builder library. I've just spent the last week travelling and to keep myself occupied I spent some time re-architecting the library's code; removing the framework dependancy, making it Composer friendly and adding a full suite of unit tests. Check out the code on Github - https://github.com/alexbilbie/MongoQB.
The library makes it simpler to do most of the usual CRUD (Create, Read, Update, Delete) operations with your Mongo data. Example code is included in the post. This is a nice lightweight alternative to things like the Doctrine query builder.
voice your opinion now!
mongoqb query builder database project
VG Tech Blog: Using Elastica to Query ElasticSearch
by Chris Cornutt July 03, 2012 @ 08:55:10
On the VG Tech blog today there's a new post by Christer Edvartsen about using the Elastica PHP Elastic Search client to do more than just pull information out of the data source. He dug into the source of the tool itself and figured out a way to perform actual queries.
The last couple of months I have been playing around with elasticsearch, an open source, distributed, RESTful search engine built on top of Apache Lucene. To interact with elasticsearch in PHP I have been using a client called Elastica. This was all fun and games until I needed to do actual queries, which is what our users will be doing most of the time. Elastica's documentation does not (yet) say anything about how to search using the client, so I needed to dig through the code to see if I could find some solutions.
He includes a sample mapping structure and shows how to take both a simple, single-term query and turn it into a request and how to make a more complex request with filters, facets, sorting and a few other things thrown in. He also shows how you can manually create a query (define the JSON structure yourself) and push that into the "query builder" for handling.
voice your opinion now!
elastica elasticsearch query tutorial
Lukas Smith's Blog: Query parameter handling in Symfony2
by Chris Cornutt May 14, 2012 @ 11:56:37
Lukas Smith is looking for feedback about a question that's been in his mind a lot lately - can the handling of query parameters be made better for the Symfony2 framework (and even easier to use).
Obviously you can already access query parameters today already but it could be easier. Essentially what I want is a way for developers to easily configure what query parameters they expect and what values they expect. This is useful for several things like easier reading and validating of query parameters, self documenting API both for API docs for humans but also for machines.
He's asking for feedback and ideas from the community on a proposed solution that could make things more flexible. He also briefly mentions the route matching and how qurey parameters could cause them not to match:
For one I don't think that a mismatch on a route requirement of a query parameter cause the route to not match. However then it can quickly become confusing for the end user or it would require adding more and more syntax to handle all the different cases.
voice your opinion now!
symfony2 query parameter handling solution routing match
PHPMaster.com: MongoDB Revisited
by Chris Cornutt January 17, 2012 @ 12:44:07
In this new post to PHPMaster.com today Ahmed Shreef continues on from his previous introduction to MongoDB and gets into more detail on things like cursors, query operators, queries on embedded documents and the sort/skip methods.
In my previous article Introduction to MongoDB I discussed installing Mongo, its PHP extension, and how to perform simple insert and find operations. Of course there are many, many more features than what I mentioned so I wanted to write another article to show you some of them.
Other topics mentioned include queries on arrays of data and running queries with indexes to improve their performance. Code is also included for each example.
voice your opinion now!
mongodb tutorial cursor query index sort skip
Johannes Schlüter's Blog: MySQL Query Analyzer and PHP
by Chris Cornutt September 30, 2011 @ 12:56:54
Johannes Schlüter has a new post to his blog today mentioning the beta release of the mysqlnd_ms plugin (previously mentioned by Ulf Wendel and a new feature that can be plugged into the MySQL Enterprise Monitor to make the Query Analyzer directly use PHP instead.
When running a PHP-based application with MySQL it is often quite interesting to see what actually happens on the database sever. Besides monitoring of the system load etc. it is often interesting to see what queries are actually executed and which of them are expensive. A part of MySQL Enterprise Monitor is the MySQL Query Analyzer which helps answering these questions.
This was handled via a proxy that sat between the database and app server and ran through the queries looking for improvements. This new plugin keeps it closer to PHP itself without having to hit against the proxy. You can see the result in these two screenshots from inside the Manager application. You also have the side benefit of getting a stack trace of it running through the app to help you identify the spots most needing improvement in the code too.
voice your opinion now!
mysql query analyze mysqlndms plugin enterprise monitor
|
Community Events
Don't see your event here? Let us know!
|