Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support truncate #11

Open
dbrgn opened this issue Jul 17, 2012 · 0 comments
Open

Support truncate #11

dbrgn opened this issue Jul 17, 2012 · 0 comments

Comments

@dbrgn
Copy link
Contributor

dbrgn commented Jul 17, 2012

Currently, it's not possible to delete all items in the index.

In [8]: CompanyIndex.objects.all()[:].delete()
SELECT `id`, `customer_id` FROM sphinx_company_rt

DELETE FROM sphinx_company_rt WHERE id IN (22554, 22553, 22552, 22551, 22550, 22549, 22548, 22547, 22546, 22545, 22544, 22543, 22542, 22541, 22540, 22539, 22538, 22537, 22536, 22535)

The first SELECT without a limit returns only 20 entries, so only those 20 entries are removed.

Current trunk version added support for the TRUNCATE INDEX indexname command. That could help.

Maybe it's possible to alter the function of the .delete() statement? Otherwise, could we add a .truncate() option to execute a TRUNCATE INDEX statement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant