473,811 Members | 3,314 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

About TSearch2 Performance

Hi,

Is there any performance diference between the following SQL commands:

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

SELECT * FROM documents WHERE content_ix @@ to_tsquery('wor d1') AND
content_ix @@ to_tsquery('wor d2') OR content_ix @@ to_tsquery('wor d3');

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*******@postg resql.org

Nov 12 '05 #1
3 2055
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('wor d1&word2|word3' );

SELECT * FROM documents WHERE content_ix @@ to_tsquery('wor d1') AND
content_ix @@ to_tsquery('wor d2') OR content_ix @@ to_tsquery('wor d3');

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.r u
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.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('wor d1&word2|word3' );

SELECT * FROM documents WHERE content_ix @@ to_tsquery('wor d1') AND
content_ix @@ to_tsquery('wor d2') OR content_ix @@ to_tsquery('wor d3');

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('wor d1&word2|word3' );

SELECT * FROM documents WHERE content_ix @@ to_tsquery('wor d1') AND
content_ix @@ to_tsquery('wor d2') OR content_ix @@ to_tsquery('wor d3');

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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #4

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

Similar topics

25
3498
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 within a try statement myself, or is there some clever implementation enhancement which makes this a bad idea? i.e. should I prefer: if hasattr(self,"datum"): datum=getattr("datum") else: datum=None
1
1501
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
1432
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 surprise we did not find significant differences. Each of our servers (2 and 4 CPU machine) has one 1Gbit network connection. I have feelings that the machines are the network bounded, not the CPU bounded. Could it be true? How to verify it?
0
387
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. My test app performs inserts across 4 related tables, each set of 4 inserts representing a single theoretical "device" object. I report how many "devices" I have inserted, per second, for example... 41509 devices inserted, 36/sec 41544...
9
2008
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 problem with my configuration? tsearch2=# select * from ts_debug('jmenuji se Pavel Stìhule a bydlím ve Skalici.');
1
1791
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 docs in \contrib\tsearch2\docs i want some tech docs on tsearch2 thank all---------------------------(end of broadcast)---------------------------TIP 2: you can get off all lists at once with the unregister command (send "unregister...
3
1880
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 - Identify bottlenecks before tuning - Optimization when dealing with objects - Optimize I/O behavior
1
1121
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 7200RPM Hard Drive 1500GB Bandwidth CentOS Linux Operating System 100Mbps Port + 10 IP's (20 Max)
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.