Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Too many LWLock...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 15333 of 17602
Post > Topic >>

Too many LWLocks taken in query using pg_tgrm & GIN index

by craig@[EMAIL PROTECTED] (Craig Ringer) Apr 21, 2008 at 01:49 PM

Hi

I've just hit a reproducible error with a query that uses pg_trgm:

ERROR:  too many LWLocks taken

I'm using PostgreSQL 8.3.1 .

The database is the one generated by the script I posted recently for
reading .po files. It's tiny, with only 7000 records in the table being
queried to produce this error. It's also easily generated using that
script.

I'm encountering the error with the following query, which seeks to find
similar looking messages:

SELECT a.message, b.message FROM po_message a, po_message b
WHERE a.id <> b.id AND a.message % b.message
ORDER BY similarity(a.message,b.message) desc;

The query is intended to find similar looking messages as a test to make
sure the po reader script isn't inserting multiple slightly different
versions of a message from different po files.

If I remove the ORDER BY clause the error still occurs. The error does
not occur if I remove the '%' operator.

The table in question has a GIN index on the `message' column. If I drop
that index and replace it with a GIST index, the issue no longer occurs.

Dropping the index and recreating it as GIN again causes the problem to
reappear, so it wasn't a corrupt index.

Here's the query plan for the query without the ORDER BY:


EXPLAIN SELECT a.message, b.message FROM po_message a, po_message b
WHERE a.id <> b.id AND a.message % b.message;

                                           QUERY PLAN
-------------------------------------------------------------------------------------------------
 Nested Loop  (cost=0.00..8259.37 rows=59436 width=94)
   Join Filter: (a.id <> b.id)
   ->  Seq Scan on po_message a  (cost=0.00..161.10 rows=7710 width=51)
   ->  Index Scan using po_message_trigrm_idx on po_message b
       (cost=0.00..0.93 rows=8 width=51)
         Index Cond: (a.message % b.message)
         Filter: (a.message % b.message)
(6 rows)

This isn't an issue for me, but I thought I should post it in case it
does indicate a bug lurking somewhere, like some kind of lock leak in
the tgrm gin index code. Ideas?

--
Craig Ringer

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 2 Posts in Topic:
Too many LWLocks taken in query using pg_tgrm & GIN index
craig@[EMAIL PROTECTED]   2008-04-21 13:49:26 
Re: Too many LWLocks taken in query using pg_tgrm & GIN index
tgl@[EMAIL PROTECTED] (T  2008-04-21 01:03:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:48:39 CST 2008.