![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
What are the techniques for searching large tables without index (SELECT id FROM big_table WHERE name LIKE '%search%'). With index, queries are usually fast enough, but queries as above are to slow. |
#3
| |||
| |||
|
|
Pet wrote: What are the techniques for searching large tables without index (SELECT id FROM big_table WHERE name LIKE '%search%'). With index, queries are usually fast enough, but queries as above are to slow. |
|
This is not possible; the only thing I can think of is a full text search, but this is not what you have in mind: You could find "I wonder who searches for entries like this", but not "No research will ever locate this entry". http://www.postgresql.org/docs/curre...extsearch.html Yours, Laurenz Albe |
#4
| |||
| |||
|
|
Thanks for your reply! I think full text search is in many cases sufficient and if nothing found, I could fire slowest query then. |
|
What about matching for chars with accent? If someone search for Andre Rene how can I match to André René? Or L'Ambre to Ambre or vice versa? Will full text do that? |
#5
| ||||
| ||||
|
|
Pet wrote: Thanks for your reply! I think full text search is in many cases sufficient and if nothing found, I could fire slowest query then. Hmmm - doesn't that mean that if there is no match, you will always run a query that does a full table scan? |
|
Are you sure that you would like that? |
|
What about matching for chars with accent? If someone search for Andre Rene how can I match to André René? Or L'Ambre to Ambre or vice versa? Will full text do that? Not always. I don't know very much about PostgreSQL's full text search, but my research has shown that it depends on the dictionary in use. For "normal" words, PostgreSQL uses a "Snowball dictionary" by default, which performs "stemming" (linguistic normalization). The German Snowball stemmer, for example, will convert an Umlaut like "ü" to the base character "u", while no such conversion is performed on "é" by the French Snowball stemmer. You can create your own dictionaries, but I don't know if you are willing to get that deeply involved (http://snowball.tartarus.org/). |
|
Yours, Laurenz Albe |
#6
| |||
| |||
|
|
What about matching for chars with accent? If someone search for Andre Rene how can I match to André René? Or L'Ambre to Ambre or vice versa? Will full text do that? Not always. I see. Currently I do conversion to ASCII with python, works fine so far for any chars |
#7
| |||
| |||
|
|
Thanks for your reply! I think full text search is in many cases sufficient and if nothing found, I could fire slowest query then. What about matching for chars with accent? If someone search for Andre Rene how can I match to André René? Or L'Ambre to Ambre or vice versa? Will full text do that? |
![]() |
| Thread Tools | |
| Display Modes | |
| |