{"id":2923,"date":"2007-11-05T10:09:23","date_gmt":"2007-11-05T17:09:23","guid":{"rendered":"https:\/\/redfindevelop.wpengine.com\/blog\/devblog\/2007\/11\/elephant_versus_dolphin_which_is_faster_which_is_smarter.html"},"modified":"2020-10-05T13:12:51","modified_gmt":"2020-10-05T20:12:51","slug":"elephant_versus_dolphin_which_is_faster_which_is_smarter","status":"publish","type":"post","link":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/","title":{"rendered":"Elephant versus Dolphin: Which is Faster?  Which is Smarter?"},"content":{"rendered":"<p><a href=\"http:\/\/www.postgresql.org\/\"><img decoding=\"async\" src=\"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant2.png\" alt=\"Elephant\" \/><\/a> vs.<a href=\"http:\/\/www.mysql.com\/\"><img decoding=\"async\" src=\"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/dolphin.gif\" alt=\"MySQL\" \/><\/a><\/p>\n<p>Redfin recently switched some of our backend DB infrastructure from <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/index.html\">MySQL<\/a> to <a href=\"http:\/\/www.postgresql.org\/docs\/8.2\/static\/index.html\">Postgres<\/a>, and we plan to wholly switch to Postgres in the near future. This wasn\u2019t an easy decision; MySQL has a lot going for it, and switching has been a lot of work.  However, we\u2019ve already seen major benefits from choosing Postgres, and we expect to see more as we complete our transition.  In particular, performance on certain geographic queries has improved dramatically.<br \/>\nA <a href=\"http:\/\/www.google.com\/search?q=postgres%20mysql\">simple Google search<\/a> shows that a lot of people have already opined about MySQL versus Postgres (e.g. <a href=\"http:\/\/articles.techrepublic.com.com\/5100-22-1050671.html\">here<\/a>, <a href=\"http:\/\/www.devx.com\/dbzone\/Article\/20743\">here<\/a>, <a href=\"http:\/\/www-css.fnal.gov\/dsg\/external\/freeware\/pgsql-vs-mysql.html\">here<\/a>, <a href=\"http:\/\/www.postgresql.org\/docs\/techdocs.83\">here<\/a>, <a href=\"http:\/\/lists.mysql.com\/mysql\/14915\">here<\/a>, and <a href=\"http:\/\/www.suite101.com\/article.cfm\/oracle\/115560\">here<\/a>) but we weren&#8217;t able to find much information that applied directly to the problem we were having.  Specifically, we were having some major performance problems with queries that were constrained by both spatial and numeric columns, and all of our attempts to squeeze more performance out of MySQL (including hiring expensive outside consultants) had come to naught.<\/p>\n<h2>GIS Indexes<\/h2>\n<p>Redfin is an online real estate company, and our map based UI is the most-used part of our web site (as well as being the biggest performance hog.) When a user views the map, we use SQL to find the relevant listings or past sales.  Users typically constrain a search by numerous criteria, such as maximum price or minimum square footage.  Since the UI is map based, users are ALWAYS constraining by geography, though that constraint might be weak.<\/p>\n<h3>How We Did It In MySQL<\/h3>\n<p>In MySQL, the queries might look something like:<\/p>\n<p><code>SELECT<\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;*<\/code><br \/>\n<code>FROM<\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;listings<\/code><br \/>\n<code>WHERE <\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;price &lt;= 400000 AND <\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;num_bedrooms &gt;= 2 AND <\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;num_bathrooms &gt;= 1.5 AND <\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;type = 'condo' AND <\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;MBRContains(GeomFromText('POLYGON((X1 Y1,X1 Y2,X2 Y2,X2 Y1,X1 Y1))'), centroid_col) <\/code><br \/>\n<code>LIMIT <\/code><br \/>\n<code>&nbsp;&nbsp;&nbsp;&nbsp;101<\/code><\/p>\n<p>where X1\/Y1 and X2\/Y2 are lat\/long pairs that describe the region to be searched. To improve performance, we create indexes on the relevant columns. In MySQL, a <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/create-index.html\">normal index<\/a> cannot include spatial columns, and spatial indexes cannot include normal columns.  In this example, we might have one multi-column index on price, num_bedrooms, and num_bathrooms, and another single-column index on centroid_col. In many cases, this performs great.  Examples include: <\/p>\n<ul>\n<li>When the table is small (we have hundreds of thousands of listings, but tens of millions of past sales records)<\/li>\n<li>When the geographic constraint is very selective (i.e. when the map is zoomed very far in)<\/li>\n<li>When the geographic constraint is the only constraint (i.e. the user doesn\u2019t care about price, bedrooms, etc.)<\/li>\n<li>When the constraints are poor, but the LIMIT amount is hit quickly (e.g. search for all listings in the the world; MySQL can quickly find the first 101 rows in the table, and once it&#8217;s found 101, it can give up)<\/li>\n<\/ul>\n<p>However, there were also cases where it performed terribly, particularly when the table was big, the geographic constraints were relatively weak, and other constraints were relatively strong.  For example, a search for all past sales in the San Francisco Bay Area that had 1 bedroom, but sold for over $10,000,000 resulted in a \u201ckiller\u201d query.  This is a little counterintuitive, but was definitely a problem for our customers (though my example is a very extreme case.) The problem with this query is that:<\/p>\n<ul>\n<li>The table is large (tens of millions of rows)<\/li>\n<li>The geographic index is the best index to use, but still isn\u2019t great (might return 500,000 rows, or ~1% of the table)<\/li>\n<li>MySQL would \u201cshort circuit\u201d the query when 101 records were found, but the query returns less than 101 records (there are few 1 bedroom condos that sold for more than $10M), so MySQL examines all 500,000 rows that match the geographic constraint<\/li>\n<\/ul>\n<p>This does happen in real life.<br \/>\nFor example, a user might be looking at homes in a small neighborhood.  She&#8217;s looking for a 2 bedroom condo between $350k and $375k with a view (a fairly heavily constrainted query.) Then she zooms the map out a few levels (maybe she wants to see a lot of the map to pick out other neighborhoods of interest.)  She has just unwittingly made a killer query- she&#8217;s searching a large geography with tight constraints on other attributes.<br \/>\nAnother example is an investor- someone who wants to search large geographic areas for &#8220;fixer&#8221; properties that have a low asking price and large living area.  Again, this results in a query that&#8217;s tightly constrained by some criteria, but relatively loosely constrained by geography.<\/p>\n<h3>Postgres and PostGIS<\/h3>\n<p>Jeff Yee, our intrepid head of QA, pointed out that geographic indexes in Postgres are supported through the feature-rich <a href=\"http:\/\/postgis.refractions.net\/docs\/\">PostGIS<\/a> plug-in.  PostGIS supports all sorts of <a href=\"http:\/\/postgis.refractions.net\/docs\/ch06.html#id2809019\">goodies<\/a> (such as polygon containment, distance calculations, projection conversion, etc.), but the biggest gain is support for <a href=\"http:\/\/postgis.refractions.net\/docs\/ch04.html#id2807089\">indexes on multiple, mixed-type columns<\/a>.  Using PostGIS, we could create an index on centroid_col, price, and num_bedrooms.  These indexes turned many of our \u201ckiller\u201d queries into pussycats.  It was immediately obvious that for Redfin, PostGIS is a Very Good Thing. PostGIS offers us more than just a huge performance improvement and robust, sophisticated geographic functionality.  It also offers an active community- there are lots of users available to answer <a href=\"http:\/\/postgis.refractions.net\/pipermail\/postgis-users\/2007-August\/016732.html\">silly newbie questions<\/a>, and the software is being actively developed.  On top of that, there\u2019s a great Windows installer.<\/p>\n<h2>Other Considerations<\/h2>\n<h3>MyISAM and Data Corruption<\/h3>\n<p>In MySQL, our tables were <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/myisam-storage-engine.html\">MyISAM<\/a>, since the geometric indexes we used were only supported on MyISAM tables.  MyISAM generally offers very good performance, but unfortunately we\u2019ve experienced data corruption on our production systems a number of times.  It\u2019s VERY painful, but we can live with occasional corruption if that\u2019s the only way to deliver the performance we seek.  PostGIS has given us another option, and we expect the advanced locking and data protection in Postgres to make data corruption a thing of the past.<\/p>\n<h3>Replication<\/h3>\n<p>We use a \u201csingle master-multiple slave\u201d configuration in production, which requires data replication. The MySQL replication options are not super flexible, but they did exactly what we needed them to do, and they did it really well.  Replication was easy to set up, easy to monitor, and proved to be very reliable. In Postgres, we had more options, and more confusion.  It took us a while to work out exactly how we would do replication; validating and implementing that plan took considerable effort.  It\u2019s in production now, and it is working fine, but it was certainly a lot more effort than in MySQL.  There\u2019s also an ongoing cost- replicating DDL changes is more complicated under Postgres than it was under MySQL.<\/p>\n<h3>Advanced Features<\/h3>\n<p>Advanced PostGIS features such as polygon matching and distance calculation have already helped us move much more quickly on Redfin features.  Most of these things CAN be done in MySQL (e.g. by post-processing query results in Java using the excellent <a href=\"http:\/\/www.vividsolutions.com\/jts\/jtshome.htm\">JTS Topology Suite<\/a> library from Vivid Solutions), but it\u2019s significantly more work, and in some cases would degrade performance.  Hopefully, you\u2019ll see new Redfin features in the near future, and think to yourself \u201cAah, they\u2019re making PostGIS do the heavy lifting- the lazy bastards.\u201d Postgres also contains advanced features that we were able to immediately benefit from.  In particular, we use the <a href=\"http:\/\/www.postgresql.org\/docs\/8.2\/static\/sql-cluster.html\">CLUSTER<\/a> command to optimize our table for access via the multicolumn geographic index.<\/p>\n<h2>Conclusion<\/h2>\n<p>Switching to Postgres was a lot of work.  This was compounded by the fact that we chose to \u201ctoe-dip\u201d into Postgres- most of our tables are still in MySQL- so our Java code is cluttered with logic to choose the correct DB connection for each query, to construct the \u201ccorrect\u201d SQL for each DB (most Redfin developers were not required to use Postgres during the development cycle, and we wanted to be able to fall back to MySQL if Postgres turned out to be a disaster), etc.  We use <a href=\"http:\/\/www.hibernate.org\/\">Hibernate<\/a> for persistence, which added another layer of complexity. However, when I see the performance gains we\u2019ve made, I know it\u2019s all worth while.  The best cases probably aren\u2019t much better, but the worst cases are startlingly better.  Postgres and PostGIS let me feel good about telling my friends to use \u201cpast sales\u201d searches on Redfin- I\u2019m confident they won\u2019t be waiting long for their results!<br \/>\nDolphins may be smarter than elephants, but in the end, elephants are domesticable and can carry a heavy load.<br \/>\n<a href='http:\/\/www.flickr.com\/photos\/autanex\/300488148\/' title='elephant_lift'><img src='https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant_lift.jpg' alt='elephant_lift' \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>vs. Redfin recently switched some of our backend DB infrastructure from MySQL to Postgres, and we plan to wholly switch to Postgres in the near future. This wasn\u2019t an easy decision; MySQL has a lot going for it, and switching has been a lot of work. However, we\u2019ve already seen major benefits from choosing Postgres, [&hellip;]<\/p>\n","protected":false},"author":13401,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[57],"tags":[],"dashboard":[],"coauthors":[],"class_list":["post-2923","post","type-post","status-publish","format-standard","hentry","category-company-news"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.7 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Elephant versus Dolphin: Which is Faster? Which is Smarter? - Redfin Real Estate News<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Elephant versus Dolphin: Which is Faster? Which is Smarter?\" \/>\n<meta property=\"og:description\" content=\"vs. Redfin recently switched some of our backend DB infrastructure from MySQL to Postgres, and we plan to wholly switch to Postgres in the near future. This wasn\u2019t an easy decision; MySQL has a lot going for it, and switching has been a lot of work. However, we\u2019ve already seen major benefits from choosing Postgres, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/\" \/>\n<meta property=\"og:site_name\" content=\"Redfin Real Estate News\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/redfin\" \/>\n<meta property=\"article:published_time\" content=\"2007-11-05T17:09:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-05T20:12:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant2.png\" \/>\n<meta name=\"author\" content=\"Michael Smedberg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@redfin\" \/>\n<meta name=\"twitter:site\" content=\"@redfin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Smedberg\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/\"},\"author\":{\"name\":\"Michael Smedberg\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/person\\\/1ec44a1785738a92423e0392733cbd87\"},\"headline\":\"Elephant versus Dolphin: Which is Faster? Which is Smarter?\",\"datePublished\":\"2007-11-05T17:09:23+00:00\",\"dateModified\":\"2020-10-05T20:12:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/\"},\"wordCount\":1371,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/redfin.com\\\/blog\\\/devblog\\\/wp-content\\\/uploads\\\/sites\\\/3\\\/2007\\\/11\\\/elephant2.png\",\"articleSection\":[\"Company News\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#respond\"]}],\"copyrightYear\":\"2007\",\"copyrightHolder\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/\",\"name\":\"Elephant versus Dolphin: Which is Faster? Which is Smarter? - Redfin Real Estate News\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/redfin.com\\\/blog\\\/devblog\\\/wp-content\\\/uploads\\\/sites\\\/3\\\/2007\\\/11\\\/elephant2.png\",\"datePublished\":\"2007-11-05T17:09:23+00:00\",\"dateModified\":\"2020-10-05T20:12:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#primaryimage\",\"url\":\"https:\\\/\\\/redfin.com\\\/blog\\\/devblog\\\/wp-content\\\/uploads\\\/sites\\\/3\\\/2007\\\/11\\\/elephant2.png\",\"contentUrl\":\"https:\\\/\\\/redfin.com\\\/blog\\\/devblog\\\/wp-content\\\/uploads\\\/sites\\\/3\\\/2007\\\/11\\\/elephant2.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/elephant_versus_dolphin_which_is_faster_which_is_smarter\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.redfin.com/news\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Elephant versus Dolphin: Which is Faster? Which is Smarter?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#website\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/\",\"name\":\"Redfin Real Estate News\",\"description\":\"The latest real estate news and research from technology-powered residential real estate company, Redfin.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.redfin.com/news\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\",\"name\":\"Redfin\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.redfin.com\\\/news\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Redfin-News-Logo.png\",\"contentUrl\":\"https:\\\/\\\/www.redfin.com\\\/news\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Redfin-News-Logo.png\",\"width\":1100,\"height\":235,\"caption\":\"Redfin\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/redfin\",\"https:\\\/\\\/x.com\\\/redfin\",\"https:\\\/\\\/www.instagram.com\\\/redfinrealestate\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/redfin\",\"https:\\\/\\\/www.pinterest.com\\\/redfin\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Redfin\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/person\\\/1ec44a1785738a92423e0392733cbd87\",\"name\":\"Michael Smedberg\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Redfin-2025-Logo-B-150x150.jpgb98d1f204d143aab6d4240c534a1657e\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Redfin-2025-Logo-B-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Redfin-2025-Logo-B-150x150.jpg\",\"caption\":\"Michael Smedberg\"},\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/author\\\/michael-smedbergredfin-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Elephant versus Dolphin: Which is Faster? Which is Smarter? - Redfin Real Estate News","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/","og_locale":"en_US","og_type":"article","og_title":"Elephant versus Dolphin: Which is Faster? Which is Smarter?","og_description":"vs. Redfin recently switched some of our backend DB infrastructure from MySQL to Postgres, and we plan to wholly switch to Postgres in the near future. This wasn\u2019t an easy decision; MySQL has a lot going for it, and switching has been a lot of work. However, we\u2019ve already seen major benefits from choosing Postgres, [&hellip;]","og_url":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/","og_site_name":"Redfin Real Estate News","article_publisher":"https:\/\/www.facebook.com\/redfin","article_published_time":"2007-11-05T17:09:23+00:00","article_modified_time":"2020-10-05T20:12:51+00:00","og_image":[{"url":"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant2.png","type":"","width":"","height":""}],"author":"Michael Smedberg","twitter_card":"summary_large_image","twitter_creator":"@redfin","twitter_site":"@redfin","twitter_misc":{"Written by":"Michael Smedberg","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#article","isPartOf":{"@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/"},"author":{"name":"Michael Smedberg","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/person\/1ec44a1785738a92423e0392733cbd87"},"headline":"Elephant versus Dolphin: Which is Faster? Which is Smarter?","datePublished":"2007-11-05T17:09:23+00:00","dateModified":"2020-10-05T20:12:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/"},"wordCount":1371,"commentCount":0,"publisher":{"@id":"https:\/\/www.redfin.com\/news\/#organization"},"image":{"@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#primaryimage"},"thumbnailUrl":"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant2.png","articleSection":["Company News"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#respond"]}],"copyrightYear":"2007","copyrightHolder":{"@id":"https:\/\/www.redfin.com\/news\/#organization"}},{"@type":"WebPage","@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/","url":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/","name":"Elephant versus Dolphin: Which is Faster? Which is Smarter? - Redfin Real Estate News","isPartOf":{"@id":"https:\/\/www.redfin.com\/news\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#primaryimage"},"image":{"@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#primaryimage"},"thumbnailUrl":"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant2.png","datePublished":"2007-11-05T17:09:23+00:00","dateModified":"2020-10-05T20:12:51+00:00","breadcrumb":{"@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#primaryimage","url":"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant2.png","contentUrl":"https:\/\/redfin.com\/blog\/devblog\/wp-content\/uploads\/sites\/3\/2007\/11\/elephant2.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.redfin.com\/news\/elephant_versus_dolphin_which_is_faster_which_is_smarter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redfin.com\/news\/"},{"@type":"ListItem","position":2,"name":"Elephant versus Dolphin: Which is Faster? Which is Smarter?"}]},{"@type":"WebSite","@id":"https:\/\/www.redfin.com\/news\/#website","url":"https:\/\/www.redfin.com\/news\/","name":"Redfin Real Estate News","description":"The latest real estate news and research from technology-powered residential real estate company, Redfin.","publisher":{"@id":"https:\/\/www.redfin.com\/news\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redfin.com\/news\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redfin.com\/news\/#organization","name":"Redfin","url":"https:\/\/www.redfin.com\/news\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/logo\/image\/","url":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2020\/10\/Redfin-News-Logo.png","contentUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2020\/10\/Redfin-News-Logo.png","width":1100,"height":235,"caption":"Redfin"},"image":{"@id":"https:\/\/www.redfin.com\/news\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/redfin","https:\/\/x.com\/redfin","https:\/\/www.instagram.com\/redfinrealestate\/","https:\/\/www.linkedin.com\/company\/redfin","https:\/\/www.pinterest.com\/redfin\/","https:\/\/en.wikipedia.org\/wiki\/Redfin"]},{"@type":"Person","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/person\/1ec44a1785738a92423e0392733cbd87","name":"Michael Smedberg","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2025\/06\/Redfin-2025-Logo-B-150x150.jpgb98d1f204d143aab6d4240c534a1657e","url":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2025\/06\/Redfin-2025-Logo-B-150x150.jpg","contentUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2025\/06\/Redfin-2025-Logo-B-150x150.jpg","caption":"Michael Smedberg"},"url":"https:\/\/www.redfin.com\/news\/author\/michael-smedbergredfin-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts\/2923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/users\/13401"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/comments?post=2923"}],"version-history":[{"count":0,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts\/2923\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/media?parent=2923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/categories?post=2923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/tags?post=2923"},{"taxonomy":"dashboard","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/dashboard?post=2923"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/coauthors?post=2923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}