From: Igor Zubkov <igor.zubkov@gmail.com>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] postgresql index row
Date: Fri, 12 Nov 2010 18:06:59 +0200
Message-ID: <AANLkTim=dPg4LhWfr2a=-6FoANQyiq2GL3AAxyg6jEB2@mail.gmail.com> (raw)
In-Reply-To: <20101112074704.GA16999@altlinux.org>
2010/11/12 Alexey I. Froloff:
> On Fri, Nov 12, 2010 at 04:05:03AM +0200, Igor Zubkov wrote:
>> == AddIndexOnChangelogtext: migrating ========================================
>> -- add_index(:changelogs, :changelogtext)
> Занахрена?
Вот что бы такой запрос к БД работал быстро, а не как сейчас...
ree-1.8.7-2010.02 > Changelog.where('changelogtext LIKE \'%CVE%\'').count
=> 4288
ree-1.8.7-2010.02 >
2010/11/12 Ivan Fedorov:
> Igor Zubkov writes:
>> Hi!
>>
>> Никто не сталкивался вот с таким?
>>
>> == AddIndexOnChangelogtext: migrating ========================================
>> -- add_index(:changelogs, :changelogtext)
> Ну во первых и впрямь, "а нахрена?!".
Для быстрого поиска.
> А во вторых оно всё равно не будет хорошо работать. Если вам нужен поиск
> по тексту - то надо пользоваться FTS движками. В PostgreSQL например
> встроен tsearch2. Из отдельных - Sphinx весьма неплох, да и настроить не
> имея опыта его проще чем tsearch2.
Ммм... А Sphinx умеет правильно работать с бинарными полями? Просто
это самое поле ещё и BINARY в postgresql у меня.
> А обычные btree индексы нормально искать по тексту всё равно не
> позволят. А если нужна проверка на уникальность, то там и индекса от
> какого-нить хэша хватит.
2010/11/12 Денис Смирнов:
> On Fri, Nov 12, 2010 at 04:05:03AM +0200, Igor Zubkov wrote:
>
> IZ> Никто не сталкивался вот с таким?
>
> А есть хоть какой-то смысл от _индекса_ по полю немеряного размера?
Понятия не имею. :)
> Даже если бы это работало -- это было бы все равно ужасно. Опиши какую
> задачу ты хочешь решить этим странным действием, и тогда тебе подскажут
> как ее решить красиво.
Дано много-примного записей из changelog'ов пакетов. Примерно:
ree-1.8.7-2010.02 > Changelog.count(:all)
=> 690859
ree-1.8.7-2010.02 >
Столько :)
Охота вытаскивать из этой кучи только те в которых есть упоминание о
CVE. Без индекса это просто медленно. Индекс не делается.
Вот думаю, а не воткнуть ли туда sphinx? Или как бы ещё решить такую задачку.
--
Igor Zubkov
http://hi.im/ice
next prev parent reply other threads:[~2010-11-12 16:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-12 2:05 Igor Zubkov
2010-11-12 7:47 ` Alexey I. Froloff
2010-11-12 16:06 ` Igor Zubkov [this message]
2010-11-12 16:25 ` Alexey I. Froloff
2010-11-12 16:44 ` Денис Смирнов
2010-11-12 16:39 ` Денис Смирнов
2010-11-13 6:23 ` Alex Gorbachenko
2010-11-13 8:49 ` Денис Смирнов
2010-11-13 10:07 ` Ivan Fedorov
2010-11-12 9:58 ` Ivan Fedorov
2010-11-12 10:48 ` Денис Смирнов
2010-11-12 12:25 ` [sisyphus] [JT] " Ivan Fedorov
2010-11-13 4:31 ` REAL
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTim=dPg4LhWfr2a=-6FoANQyiq2GL3AAxyg6jEB2@mail.gmail.com' \
--to=igor.zubkov@gmail.com \
--cc=sisyphus@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git