Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Proof query



  Why MySQL 8 drops support of query cache

Many of you may have heard or used MySQL's query cache, because it used to be a popular way to improve MySQL's performance. As an important feature for improving MySQL's performance, the query cache was often recommended as a solution for slow queries. However, why has MySQL 8 abandoned the query cache? Today, we will analyze and explore this decision. What is query cache? According to official document: The query cache stores the text of a SELECT statement together with the correspon...

   MYSQL 8,QUERY CACHE     2023-03-11 09:05:17

  Different ways to pass query parameters in EmberJS

In EmberJS, one could pass query parameters when retrieving resources with store.query() method. But what if there is a requirement that one wants to pass query parameters when calling store.findRecord()? Or there is a requirement that one wants to pass query parameters to a relationship when calling model.get('hasManyAttribute') in a RESTful style? In this post, we will explain how these can be achieved. In the store.query() case, one could easily pass the query parameters by passing ...

   RELATIONSHIP,EMBERJS,QUERY PARAMETERS     2018-05-18 10:47:56

  Select top 3 values from each group in a table with SQL

Yesterday, my friend Liu Bing asked me a question about how to select top 3 values for each person in a database table using SQL. I think this question is interesting and it deserves some thoughts. Here I record down how to solve this issue. Assume we have a table which has two columns, one column contains the names of some people and the other column contains some values related to each person. One person can have more than one value. Each value has a numeric type. The question is we want to se...

   SQL,Correlated query,top 3     2013-05-23 03:21:25

  Including Related Objects in Queries

Every time you hit a mobile network, it slows your users down and introduces another point of failure. So when you're designing your application, you need to take advantage of every opportunity to omit needless requests. Parse's philosophy is to help make this easier by providing standard ways to reduce network requests. One example is caching queries, which lets you avoid resending requests you've already sent. Another example, which we've launched in the most recent version of the...

   Software design,Request,Network load,Resource manage,Mobile     2011-12-07 08:51:56

  strange thing in PHP session variable and local variable

A few minutes ago, I noticed one strange thing when I did my PHP web application development.The situation is described below:I want to display a user's profile using a query parameter user=user_id as the parameter. And also the session variable when user logs in  is $_SESSION["user"].So before displaying the user's profile, I need to either get the query string parameter user and create a local variable called $user and assign value to it as $user=$_REQUEST["user"].Here comes the strange t...

   PHP,session,variable name,change automat     2011-06-13 12:23:59

  Fuzzy search algorithm in Sublime Text

Fuzzy string searching is the technique of finding strings that match a pattern approximately (rather than exactly. In many editors, we can easily find the Find menu item to do exact matching. While in Sublime Text and some other editors, we can use fuzzy string searching as well if we just want to have an approximate match. There is some algorithm implemented in Sublime Text to implement achieve this. First the search query is split into characters, join them with a regex wildcard, and then run...

   Sublime Text,Fuzzy search     2013-10-14 22:49:38

  A trap in PDOStatement::bindParam

First, let's check out below codes: <?php $dbh = new PDO('mysql:host=localhost;dbname=test', "test"); $query = <<prepare($query); $bind_params = array(':username' => "laruence", ':password' => "weibo"); foreach( $bind_params as $key => $value ){ $statement->bindParam($key, $value); } $statement->execute(); What is the SQL executed finally? Is there any problem with above codes? Many people may think the query executed is : INSERT INTO `user` (`username`, `password...

   PHP,Trap,bindParam     2013-08-29 10:48:55

  Hologres vs AWS Redshift

Hologres and Redshift are both data warehousing solutions, but they have some differences in terms of features, architecture, and target use cases. Underlying Infrastructure Hologres: Built on Alibaba Cloud's Apsara distributed computing platform, Hologres leverages the underlying infrastructure for storage, computation, and management. It benefits from Alibaba's expertise in cloud-native architecture and real-time data processing. Redshift: Amazon Redshift is based on a Massively Parallel Pro...

   HOLOGRES,REDSHIFT,ALIBABA,AWS,BIG DATA,REAL-TIME     2024-03-23 01:36:41

  A Tiny MySQL++ Tutorial; C++ and MySQL; MySQL++ Example

I wrote a post about how to install MySQL++ and I thought I will write a quick tutorial on how to use it too. This is a very basic MySQL++ program and it’s very self explanatory: #include <mysql++.h> #include <stdlib.h>   using namespace std; using namespace mysqlpp;   int main() { try { Connection conn(false); conn.connect("DB NAME", "DB HOST probably localhost", "DB USER", "DB PASS"); Query query = conn.query(); } catch (BadQuery er...

   C++,Example,MySQL++,Insert,API     2011-09-05 02:12:40

  <=> operator in MySQL

Have you ever seen "<=>" in a SQL query while using MySQL? Does it mean less and equals to and greater than? Actually if you consider it as the union of <= and =>, great, you are close to it. This is one form of equal operator in MySQL, it has the similar meaning to the = operator with some subtle difference. According to MySQL documentation, <=> is NULL-safe equal. This operator performs an equality comparison like the = operator, but returns 1 rather than NULL if both operand...

   MySQL,NULL safe,<=>     2014-03-24 06:23:22