Re: getting ERROR: stack depth limit exceeded on a WHERE IN query on a view

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: getting ERROR: stack depth limit exceeded on a WHERE IN query on a view
Дата
Msg-id 2754.1393260006@sss.pgh.pa.us
обсуждение исходный текст
Ответ на getting ERROR: stack depth limit exceeded on a WHERE IN query on a view  (Aditya Rastogi <adirastogi@outlook.com>)
Ответы Re: getting ERROR: stack depth limit exceeded on a WHERE IN query on a view
Список pgsql-novice
Aditya Rastogi <adirastogi@outlook.com> writes:
> The query is similar to the following query:
>        select count(*) from gui_die_summary where (x_coord, y_coord) in
((25,5),(41,13),(25,7),(28,3),(25,8),(34,7),(26,6),(21,10));, 
> only that the list of pairs specified in the in clause is pretty large - around 5000-4000 pairs and that's when I get
thestack depth limit exceed error. 

Even without the stack depth issue, that would perform pretty horridly for
so many pairs.

Do you know that the pairs are all distinct, so that you don't really need
the duplicate-elimination behavior of IN?  If so, you could recast this
like so:

select count(*) from
  gui_die_summary,
  (values (25,5),(41,13),(25,7),(28,3),(25,8),(34,7),(26,6),(21,10)) v(vx,vy)
where (x_coord, y_coord) = (vx, vy);

which should work better for large numbers of pairs.

            regards, tom lane


В списке pgsql-novice по дате отправления:

Предыдущее
От: Aditya Rastogi
Дата:
Сообщение: getting ERROR: stack depth limit exceeded on a WHERE IN query on a view
Следующее
От: Aditya Rastogi
Дата:
Сообщение: Re: getting ERROR: stack depth limit exceeded on a WHERE IN query on a view