SQLite Forum

Difference between MATCH('x') and MATCH('x*')
Login
I'm a bit confused over exactly what the difference is between the two queries of an FTS index:

```
			sql = "SELECT rowid FROM fts WHERE fts MATCH ('x*')";
		
			sql = "SELECT rowid FROM fts WHERE fts MATCH ('x')";

```

.. where 'x' is a single character. I'm getting very different results, 


```
tsql> select rowid from fts where fts match ('x');
Time taken: 0.024171 secs, rows=6383

tsql> select rowid from fts where fts match ('x*');
Time taken: 0.147986 secs, rows=19496
```

So clearly it is different, but I'm not really seeing why -  from the description in 3.3, it seems that 'x' will match anything that 'x*' does, apart from perhaps words ending in x (therefore not a prefix), but 'x*' is matching *more* rows than 'x'.