﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Richard,
This is part of the 2.5 branch, and it is available here under the unstable builds:
http://hibernatingrhinos.com/builds/ravendb-unstable-v2.5</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment20</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment20</guid><pubDate>Wed, 20 Mar 2013 07:58:46 GMT</pubDate></item><item><title>Richard commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>When will this feature be released? I cant find an actual build containing it.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment19</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment19</guid><pubDate>Wed, 20 Mar 2013 07:27:53 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Configurator,

Because there is no query.Advanced.

This is implemented as a single stream request from the server.
The enumerator has to be disposed, yes.
If you stop reading, you need to dispose the connection, which will stop it on the server.
It doesn't have a heavy impact, beyond the usual cost of having to access all of that data.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment18</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment18</guid><pubDate>Fri, 15 Mar 2013 04:09:47 GMT</pubDate></item><item><title>configurator commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Why session.Advanced.Stream(query) and not query.Advanced.Stream()?

Also, how is this actually implemented? Specifically, I'm interested in the finer details such as what happens if I stop reading halfway through, and whether or not the IEnumerator needs to be disposed when enumeration is finished. And whether this sort of query has a large impact on server performance because it takes a snapshot of the data.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment17</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment17</guid><pubDate>Thu, 14 Mar 2013 22:34:43 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Lev,
No, there isn't.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment16</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment16</guid><pubDate>Thu, 14 Mar 2013 04:56:02 GMT</pubDate></item><item><title>Lev Gorodinski commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Is there a way to "freeze" results with the 2261 Client API if paging is used to retrieve very large subsets?</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment15</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment15</guid><pubDate>Wed, 13 Mar 2013 22:25:41 GMT</pubDate></item><item><title>Daniel Schilling commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Power users will realize it is trivial to us the `yield` keyword to turn this `IEnumerator` into an `IEnumerable`, if that's what they need.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment14</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment14</guid><pubDate>Wed, 13 Mar 2013 13:44:11 GMT</pubDate></item><item><title>Mouhong commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>@Ayende, Yea, you're right. But anyway, I can accept that the Stream() returns an enumerator. In my usage, I often don't need to do in memory filtering (can be done before calling Stream) or processing in this case. If I have a way to retrieve all records, it's already very good and enought. :p</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment13</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment13</guid><pubDate>Wed, 13 Mar 2013 07:13:08 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Mouhong,
That is a very true statement. In practice, it isn't really true. Sure it would be the user's fault. But the problem would typically still be blamed on RavenDB.
If he goes and uses TakeAllAsList(), this is not just blindly calling ToList() and not noticing the implications, this is an explicit decision.
We like to think of our API as a safety net, not a straitjacket.

But you can go and check the number of times Linq delayed eval caused problems, and the number of times a ToList() caused even more problems...</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment12</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment12</guid><pubDate>Wed, 13 Mar 2013 06:56:09 GMT</pubDate></item><item><title>Mouhong commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>@Ayende, If he use this to fix the "bug":
session.Advanced.Stream(session.Query()).ToList(); /// Fix RavenDB Bug

That's his problem, he should learn from the server carshing (if it crashed). There's no ideal solution.
Just like Daniel said, if he found that he can't use Stream().ToList(), he would search google and finally found Daniel's TakeAllAsList(). So I think limit Stream api will mostly make "power users" feel inconvenient. It can't stop newbies from using TakeAllAsList()</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment11</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment11</guid><pubDate>Wed, 13 Mar 2013 06:52:13 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Mouhong,
Or, what is likely to happen. A user will search for this.
And change:

session.Query().ToList()

To:

session.Advanced.Stream(session.Query()).ToList(); /// Fix RavenDB Bug

without ever doing any actual thinking whatsoever.
</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment10</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment10</guid><pubDate>Wed, 13 Mar 2013 06:31:11 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Daniel,
One of the things that we are trying to do in the API is to have no easy pitfalls that will kill you.
This API is really easy if you want to do streaming, as in push them to a file / network / process all of them one at a time.
It is slightly hard if you want to get them all in memory. This is by design.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment9</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment9</guid><pubDate>Wed, 13 Mar 2013 06:30:05 GMT</pubDate></item><item><title>Mouhong commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>I agree with Daniel.
If one doesn't know what he is doing, he won't use the Stream api, but use the Query&lt;&gt;().ToList(). But that is safe by default.
If one knows that there's a Stream() api, he must know what he wants to do, so no need to limit him so much</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment8</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment8</guid><pubDate>Wed, 13 Mar 2013 05:30:41 GMT</pubDate></item><item><title>Daniel Lang commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>I find it kind of sad that I can now replace my TakeAllAsList() extension method with another one that runs an iterator to populate a list. I would have preferred to have IEnumerable on which I can just call ToList().

There are power users who know what they're doing and who are just fine having all of the documents in memory. Now that we aren't limited by the size of http messages, I think we should really have a simple IEnumerable and let the users decide what to do with them.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment7</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment7</guid><pubDate>Tue, 12 Mar 2013 22:05:49 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Dan,
This will NOT lock the database in any way.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment6</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment6</guid><pubDate>Tue, 12 Mar 2013 18:07:22 GMT</pubDate></item><item><title>Ayende Rahien commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Yuriy,
 Because it is very easy to do a .ToList() on IEnumerable, which will force the entire thing to go into memory.</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment5</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment5</guid><pubDate>Tue, 12 Mar 2013 18:07:11 GMT</pubDate></item><item><title>Dan commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Will this lock the database or cause writes to be queued as long as the export is running?</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment4</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment4</guid><pubDate>Tue, 12 Mar 2013 16:54:08 GMT</pubDate></item><item><title>Yuriy commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Just out of curiosity - why not return IEnumerable?</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment3</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment3</guid><pubDate>Tue, 12 Mar 2013 16:04:50 GMT</pubDate></item><item><title>Brian Vallelunga commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Thanks. This will be very useful for the times when people want me to "export everything to a spreadsheet."</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment2</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment2</guid><pubDate>Tue, 12 Mar 2013 15:30:36 GMT</pubDate></item><item><title>njy commented on RavenDB&amp;rsquo;s Querying Streaming: Unbounded results</title><description>Pretty darn good approach, very well done</description><link>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment1</link><guid>http://ayende.com/161249/ravendb-s-querying-streaming-unbounded-results#comment1</guid><pubDate>Tue, 12 Mar 2013 13:34:28 GMT</pubDate></item></channel></rss>