> On 13 Sep 2014, at 11:25, pyArchInit ArcheoImagineers <pyarchi...@gmail.com> 
> wrote:
> 
> Il giorno giovedì 11 settembre 2014 18:39:24 UTC+2, Jonathan Vanasco ha 
> scritto:
> i once thought about extending SqlAlchemy to handle this issue behind the 
> scenes, but each database treats `IN()` differently.  for example: oracle 
> maxes out at a number of elements, while mysql maxes out based on the size of 
> the overall statement (which is configured on the server).  it's too much 
> work to limit this in sqlalchemy, as these limits change across servers.  [ i 
> forget what postgres maxed out on, i think it was a hard number too.]
> 
> the workaround I used was to just build a query-base, and then run multiple 
> selects with a single `IN` within a for-loop which appends to a list.  i 
> found that performance to be much better than chaining multiple `IN()` with 
> `OR`
>  
> My problem is to find a dataset of more than 999 records and sort all through 
> ORDER BY statement. How can I use multiple selects and order all records?

You can try a different approach, such as creating a (temporary table) which 
you fill with all your ids, and then do a SQL statement with something like 
WHERE id IN (SELECT id FROM temp_table); That bypasses any limits in the IN 
operator.

Wichert.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to