2 questions on elixir.

9 views
Skip to first unread message

Lila Boc

unread,
Sep 18, 2011, 10:15:29 PM9/18/11
to SQLElixir
Hi,

While I am a newbie to elixir, I have managed to create a database
application using elixir (thanks for making it so easy to develop the
application). However I have 2 questions on issues that are too
advanced for me.

Question 1.
I will use the movie database to discuss my need. Actor and Movie has
a many-to-many relationship. I would like to rank the movies against
each actor. Suppose I have the following records:
A1 : M1 M2 M3 M4 M5
A2 : M2 M5 M6 M7
and I want to rank them as
A1 : M4 M1 M2 M5 M3
A2 : M2 M6 M5 M7

How can I do this with elixir?

Question 2:

What must I do to ensure that the application is optimized for
queries? Do I need to create some kind of index file if the
application will be making queries against one field? The application
makes queries against different fields at different times.

Many thanks in advance. With best regards, Lila Boc.

pylover

unread,
Sep 28, 2011, 8:29:50 PM9/28/11
to SQLElixir
HI Lila.
in Persian, we call you : Leila (لیلا)

lets to talk about sqlqlchemy instead elixir.
SA is so fast in relationships but i suggest to test some situations,
and put the results in this group for all members.

test your case in two phases:
1.normalized db design(http://en.wikipedia.org/wiki/
Database_normalization):
2.denormalized db design(http://en.wikipedia.org/wiki/Denormalization)

i suggest test this case with approximately 900,000,000 records in
each table.

after ensure your architecture, (one of mentioned db design
architectures: NORMALIZATION or DENORMALIZATION)
,try to optimize your case with indexes and all other options depends
on witch RDBMS backend you are using with elixir(sqlalchemy).such as
oracle:select optimization

NOTE: SA has a powerful caching mechanism in memory.and elixir can
load relationships in two modes: lazy or not lazy, see elixir
documentation. but the performance is depends on your RDBMS, i
recomend Postgresql, open source, powerful, very very very fast in
linux.

######################################################################
Some notes about my project:
my db design is so complex and usually i design databases strongly
normalized!.
my records are over 1,000,000,000
RMBMS: postgresql-8.4
OS:Ubuntu 10.4 server
Processor:Quad core ....
Memory 4G
Average requests per minutes: 1500
AND Everything is so good.
#######################################################################
Reply all
Reply to author
Forward
0 new messages