473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

About TSearch2 Performance

Hi,

Is there any performance diference between the following SQL commands:

SELECT * FROM documents WHERE content_ix @@ to_tsquery('word1&word2|word3');

SELECT * FROM documents WHERE content_ix @@ to_tsquery('word1') AND
content_ix @@ to_tsquery('word2') OR content_ix @@ to_tsquery('word3');

I'm having to do this on some complex querys to put LIKEs between some
ts_querys.
Does anyone has such experience?

Thanks in advance,

--
Diogo Biazus
di***@ikono.com.br
http://www.ikono.com.br

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #1
3 2029
First one will be a bit faster

Diogo Biazus wrote:
Hi,

Is there any performance diference between the following SQL commands:

SELECT * FROM documents WHERE content_ix @@
to_tsquery('word1&word2|word3');

SELECT * FROM documents WHERE content_ix @@ to_tsquery('word1') AND
content_ix @@ to_tsquery('word2') OR content_ix @@ to_tsquery('word3');

I'm having to do this on some complex querys to put LIKEs between some
ts_querys.
Does anyone has such experience?

Thanks in advance,


--
Teodor Sigaev E-mail: te****@sigaev.ru
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2
Teodor Sigaev wrote:
First one will be a bit faster

Diogo Biazus wrote:
Hi,

Is there any performance diference between the following SQL commands:

SELECT * FROM documents WHERE content_ix @@
to_tsquery('word1&word2|word3');

SELECT * FROM documents WHERE content_ix @@ to_tsquery('word1') AND
content_ix @@ to_tsquery('word2') OR content_ix @@ to_tsquery('word3');

I'm having to do this on some complex querys to put LIKEs between
some ts_querys.
Does anyone has such experience?

Thanks in advance,

What do those @@ do for the statement?

--
"You are behaving like a man",
is an insult from some women,
a compliment from an good woman.

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #3
On Friday 24 October 2003 08:18, Dennis Gearon wrote:
Teodor Sigaev wrote:
First one will be a bit faster

Diogo Biazus wrote:
Hi,

Is there any performance diference between the following SQL commands:

SELECT * FROM documents WHERE content_ix @@
to_tsquery('word1&word2|word3');

SELECT * FROM documents WHERE content_ix @@ to_tsquery('word1') AND
content_ix @@ to_tsquery('word2') OR content_ix @@ to_tsquery('word3');

I'm having to do this on some complex querys to put LIKEs between
some ts_querys.
Does anyone has such experience?

Thanks in advance,


What do those @@ do for the statement?


That is an operator defined when tsearch2 is installed. It does comparison on
the types from tsearch2 (tsvector, tsquery).

Andy

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
1
by: Laser Lu | last post by:
Whether it can improve the execution effciency of ASP by centeralizing the often used code into header files and then including these header files in ASP pages? -- Best regards, Laser Lu
0
by: jacob nikom | last post by:
Hi, We ran MySQL (4.0.15-standard, 64-bit, SuSe 8.0) benchmarks on 2 CPU and 4 CPU Opteron machines. Mostly we tested insertion times with many simultaneous connections (hundreds). To our...
0
by: Clay Luther | last post by:
I am doing to large dataset performance tests with 7.3.4b2 today and I noticed an interesting phenomenon. My shared memory buffers are set at 128MB. Peak postmaster usage appears to be around 90MB....
9
by: Pavel Stehule | last post by:
Hello I try tsearch2 within czech environment. It is works fine, but I have two questions. 1. I have words "se", "ve" in my czech stop words. But I get this words in result. Why? Have I...
1
by: ˧ÃÍ | last post by:
-----ԭʼÓʼþ----- ·¢¼þÈË: ˧ÃÍ ·¢ËÍʱ¼ä: 2004Äê3ÔÂ3ÈÕ 10:41 ÊÕ¼þÈË: 'pgsql-hackers@postgresql.org' Ö÷Ìâ: docs on tsearch2 hi all Are there any other docs about tsearch2 except for the 3...
3
by: hpw | last post by:
Hi all, i'm looking for a good book about .net Performance Tuning. Things that should be covered by this book: - Glean information about your program's behavior from profiling tools -...
1
by: mdburton | last post by:
Right now I am in a VPS server, mysql constantly will run at 18% usage and slows the site down. I was wondering what you guys think about a INTEL P4 3.0GHz HT 1024MB DDR RAM 120GB...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.